The patch below does not apply to the .39-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 2f6fc351e6e8c1b6a95140e733607e32bc3a4322 Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Thu, 28 Apr 2011 15:31:57 +0530
Subject: [PATCH] ath9k: Fix drain txq failure in flush

While draining the txq in flush, the buffers can be
added into the tx queue by tx_tasklet which leads to
unneccesary chip reset.

This issue was originially found with AR9382 and
running heavy uplink udp traffic with higher bandwidth
and doing frequent bgscan.

Cc: [email protected]
Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
Signed-off-by: Rajkumar Manoharan <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index c3dbf26..efdafd2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2261,6 +2261,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool 
drop)
        struct ath_softc *sc = hw->priv;
        int timeout = 200; /* ms */
        int i, j;
+       bool drain_txq;
 
        mutex_lock(&sc->mutex);
        cancel_delayed_work_sync(&sc->tx_complete_work);
@@ -2286,7 +2287,10 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool 
drop)
        }
 
        ath9k_ps_wakeup(sc);
-       if (!ath_drain_all_txq(sc, false))
+       spin_lock_bh(&sc->sc_pcu_lock);
+       drain_txq = ath_drain_all_txq(sc, false);
+       spin_unlock_bh(&sc->sc_pcu_lock);
+       if (!drain_txq)
                ath_reset(sc, false);
        ath9k_ps_restore(sc);
        ieee80211_wake_queues(hw);

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to