aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-05 14:17:53 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 14:57:05 -0500
commit080e1a259acea10b6df8e2a8e49b47481940220a (patch)
tree1e5b3972ea040ed40a255529da5e522a6909d5be /drivers/net/wireless/ath/ath9k/main.c
parent841051602e3fa18ea468fe5a177aa92b6eb44b56 (diff)
ath9k: fix a DMA related race condition on reset
When ath_drain_all_txq fails to stop DMA, it issues a hw reset. This reset happens at a very problematic point in time, when the hardware rx path has not been stopped yet. This could lead to memory corruption, hardware hangs or other issues. To fix these issues, simply remove the reset entirely and check the tx DMA stop status to prevent problems with fast channel changes. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index dace215b693e..928ef68ab40c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -244,11 +244,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
244 * the relevant bits of the h/w. 244 * the relevant bits of the h/w.
245 */ 245 */
246 ath9k_hw_set_interrupts(ah, 0); 246 ath9k_hw_set_interrupts(ah, 0);
247 ath_drain_all_txq(sc, false); 247 stopped = ath_drain_all_txq(sc, false);
248 248
249 spin_lock_bh(&sc->rx.pcu_lock); 249 spin_lock_bh(&sc->rx.pcu_lock);
250 250
251 stopped = ath_stoprecv(sc); 251 if (!ath_stoprecv(sc))
252 stopped = false;
252 253
253 /* XXX: do not flush receive queue here. We don't want 254 /* XXX: do not flush receive queue here. We don't want
254 * to flush data frames already in queue because of 255 * to flush data frames already in queue because of