Commit 3483288c authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: ensure that rx is not enabled during a reset

During a reset, rx buffers are flushed after rx has been disabled. To avoid
race conditions, rx needs to stay disabled during the reset, so avoid any
calls to ath9k_hw_rxena in that case.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c31c8261
...@@ -247,8 +247,8 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush) ...@@ -247,8 +247,8 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
if (!flush) { if (!flush) {
if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
ath_rx_tasklet(sc, 0, true); ath_rx_tasklet(sc, 1, true);
ath_rx_tasklet(sc, 0, false); ath_rx_tasklet(sc, 1, false);
} else { } else {
ath_flushrecv(sc); ath_flushrecv(sc);
} }
......
...@@ -1839,7 +1839,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) ...@@ -1839,7 +1839,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
* If we're asked to flush receive queue, directly * If we're asked to flush receive queue, directly
* chain it back at the queue without processing it. * chain it back at the queue without processing it.
*/ */
if (flush) if (sc->sc_flags & SC_OP_RXFLUSH)
goto requeue_drop_frag; goto requeue_drop_frag;
retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs, retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
...@@ -1967,7 +1967,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) ...@@ -1967,7 +1967,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
} else { } else {
list_move_tail(&bf->list, &sc->rx.rxbuf); list_move_tail(&bf->list, &sc->rx.rxbuf);
ath_rx_buf_link(sc, bf); ath_rx_buf_link(sc, bf);
ath9k_hw_rxena(ah); if (!flush)
ath9k_hw_rxena(ah);
} }
} while (1); } while (1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment