Skip to contentSkip to conversation

ath5k: Always free tx buffers before reset

PATCH In review Nick Kossifidis 2 participants 2 messages Dec 3, 2010 Atheros ATH5K wireless driver

lore
Share & tools
lore

Nick Kossifidis

author maintainer
#0 lore raw

PATCH 2/6 ath5k: Always free tx buffers before reset

* Always free tx buffers before reset, since we also empty hw queues. If we don't and a queue gets stuck, we'll never decrease txq_len and sw will keep thinking the queue is still stuck even after reset.

---
 drivers/net/wireless/ath/ath5k/base.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +4 -2
index a8d380a..047b2a0 100644
@@ -2512,9 +2512,11 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
 	synchronize_irq(sc->pdev->irq);
 	stop_tasklets(sc);
 
+	/* We are going to empty hw queues
+	 * so we should also free any remaining
+	 * tx buffers */
+	ath5k_drain_tx_buffs(sc);
 	if (chan) {
-		ath5k_drain_tx_buffs(sc);
-
 		sc->curchan = chan;
 		sc->curband = &sc->sbands[chan->band];
 	}
Tested-by on v1 2/6
#1 lore raw
Quoted 29 lines · Nick Kossifidis

 * Always free tx buffers before reset, since we also empty hw queues. If we don't and a queue gets stuck, we'll never decrease txq_len and sw will keep thinking the queue is still stuck even after reset.

---
 drivers/net/wireless/ath/ath5k/base.c |    6 ++++--

 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +4 -2
index a8d380a..047b2a0 100644
@@ -2512,9 +2512,11 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
        synchronize_irq(sc->pdev->irq);
        stop_tasklets(sc);
 
+       /* We are going to empty hw queues
+        * so we should also free any remaining
+        * tx buffers */
+       ath5k_drain_tx_buffs(sc);
        if (chan) {
-               ath5k_drain_tx_buffs(sc);
-
                sc->curchan = chan;
                sc->curband = &sc->sbands[chan->band];
        }