From 19252ecb672d3f35959c576d1d26b9aca350f5bf Mon Sep 17 00:00:00 2001 From: Nick Kossifidis Date: Fri, 3 Dec 2010 06:05:19 +0200 Subject: [PATCH] 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. Signed-off-by: Nick Kossifidis Tested-by: Sedat Dilek Signed-off-by: John W. Linville --- drivers/net/wireless/ath/ath5k/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 5ece94708371..1522cf82c16c 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -2661,9 +2661,11 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, synchronize_irq(sc->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]; } -- 2.20.1