Otherwise we could free skbs in ath5k_drain_tx_buffs() that are
mapped and in use by the hardware during ath5k_reset().

Signed-off-by: Bob Copeland <m...@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/base.c  |    1 +
 drivers/net/wireless/ath/ath5k/reset.c |   10 +---------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c 
b/drivers/net/wireless/ath/ath5k/base.c
index 513d925..8ba3346 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2673,6 +2673,7 @@ ath5k_reset(struct ath5k_hw *ah, struct ieee80211_channel 
*chan,
        /* We are going to empty hw queues
         * so we should also free any remaining
         * tx buffers */
+       ath5k_hw_dma_stop(ah);
        ath5k_drain_tx_buffs(ah);
        if (chan)
                ah->curchan = chan;
diff --git a/drivers/net/wireless/ath/ath5k/reset.c 
b/drivers/net/wireless/ath/ath5k/reset.c
index 2abac25..4875ade 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -1060,17 +1060,9 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum 
nl80211_iftype op_mode,
         */
        ath5k_hw_stop_rx_pcu(ah);
 
-       /*
-        * Stop DMA
-        *
-        * Note: If DMA didn't stop continue
-        * since only a reset will fix it.
-        */
-       ret = ath5k_hw_dma_stop(ah);
-
        /* RF Bus grant won't work if we have pending
         * frames */
-       if (ret && fast) {
+       if (fast && ath5k_hw_tx_pending(ah)) {
                ATH5K_DBG(ah, ATH5K_DEBUG_RESET,
                        "DMA didn't stop, falling back to normal reset\n");
                fast = 0;
-- 
1.7.6


_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to