From 1da85f0f630ae3a9e294e39b411d17975cbfdd4b Mon Sep 17 00:00:00 2001 From: Vasanthakumar Thiagarajan Date: Sun, 6 Feb 2011 21:48:19 -0800 Subject: [PATCH 1/2] ath9k: Fix race in starting/stopping DMA of hw data queues pcu_lock needs to be aquired before starting DMA on a particular hw queue to avoid the race while trying to stop that queue in ath_drain_all_txq(). Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 68a1c76..07afae0 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1396,7 +1396,10 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_atx_tid *tid, TX_STAT_INC(txctl->txq->axq_qnum, a_queued_hw); bf->bf_lastbf = bf; ath_buf_set_rate(sc, bf, fi->framelen); + + spin_lock_bh(&sc->sc_pcu_lock); ath_tx_txqaddbuf(sc, txctl->txq, &bf_head); + spin_unlock_bh(&sc->sc_pcu_lock); } static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, @@ -1416,7 +1419,10 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, bf->bf_lastbf = bf; fi = get_frame_info(bf->bf_mpdu); ath_buf_set_rate(sc, bf, fi->framelen); + + spin_lock_bh(&sc->sc_pcu_lock); ath_tx_txqaddbuf(sc, txq, bf_head); + spin_unlock_bh(&sc->sc_pcu_lock); TX_STAT_INC(txq->axq_qnum, queued); } -- 1.7.0.4