ath9k: fix an issue with stopping rx/tx dma on AR93xx
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 379-ath9k-fix-DMA-stop-sequence-for-AR9003.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Tue, 2 Jun 2015 10:35:46 +0200
3 Subject: [PATCH] ath9k: fix DMA stop sequence for AR9003+
4
5 AR93xx and newer needs to stop rx before tx to avoid getting the DMA
6 engine or MAC into a stuck state.
7 This should reduce/fix the occurence of "Failed to stop Tx DMA" logspam.
8
9 Cc: stable@vger.kernel.org
10 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 ---
12
13 --- a/drivers/net/wireless/ath/ath9k/main.c
14 +++ b/drivers/net/wireless/ath/ath9k/main.c
15 @@ -216,11 +216,13 @@ static bool ath_prepare_reset(struct ath
16 ath_stop_ani(sc);
17 ath9k_hw_disable_interrupts(ah);
18
19 - if (!ath_drain_all_txq(sc))
20 - ret = false;
21 -
22 - if (!ath_stoprecv(sc))
23 - ret = false;
24 + if (AR_SREV_9300_20_OR_LATER(ah)) {
25 + ret &= ath_stoprecv(sc);
26 + ret &= ath_drain_all_txq(sc);
27 + } else {
28 + ret &= ath_drain_all_txq(sc);
29 + ret &= ath_stoprecv(sc);
30 + }
31
32 return ret;
33 }