ath9k: fix an rx path race condition that might be the cause of the "ath: DMA failed...
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 586-ath9k_fix_rx_flush.patch
1 --- a/drivers/net/wireless/ath/ath9k/recv.c
2 +++ b/drivers/net/wireless/ath/ath9k/recv.c
3 @@ -1845,7 +1845,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
4 * If we're asked to flush receive queue, directly
5 * chain it back at the queue without processing it.
6 */
7 - if (flush)
8 + if (sc->sc_flags & SC_OP_RXFLUSH)
9 goto requeue_drop_frag;
10
11 retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
12 @@ -1973,7 +1973,8 @@ requeue:
13 } else {
14 list_move_tail(&bf->list, &sc->rx.rxbuf);
15 ath_rx_buf_link(sc, bf);
16 - ath9k_hw_rxena(ah);
17 + if (!flush)
18 + ath9k_hw_rxena(ah);
19 }
20 } while (1);
21
22 --- a/drivers/net/wireless/ath/ath9k/main.c
23 +++ b/drivers/net/wireless/ath/ath9k/main.c
24 @@ -246,8 +246,8 @@ static bool ath_prepare_reset(struct ath
25
26 if (!flush) {
27 if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
28 - ath_rx_tasklet(sc, 0, true);
29 - ath_rx_tasklet(sc, 0, false);
30 + ath_rx_tasklet(sc, 1, true);
31 + ath_rx_tasklet(sc, 1, false);
32 } else {
33 ath_flushrecv(sc);
34 }