linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Fix drain txq failure in flush
@ 2011-04-28 10:01 Rajkumar Manoharan
  2011-04-29 19:27 ` John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: Rajkumar Manoharan @ 2011-04-28 10:01 UTC (permalink / raw)
  To: linville
  Cc: linux-wireless, Rajkumar Manoharan, stable,
	Vasanthakumar Thiagarajan

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: stable@kernel.org
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

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);
-- 
1.7.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Fix drain txq failure in flush
  2011-04-28 10:01 [PATCH] ath9k: Fix drain txq failure in flush Rajkumar Manoharan
@ 2011-04-29 19:27 ` John W. Linville
  2011-05-02  4:34   ` Rajkumar Manoharan
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2011-04-29 19:27 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless, stable, Vasanthakumar Thiagarajan

On Thu, Apr 28, 2011 at 03:31:57PM +0530, Rajkumar Manoharan wrote:
> 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: stable@kernel.org
> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>

Should this be a fix for 2.6.39?

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Fix drain txq failure in flush
  2011-04-29 19:27 ` John W. Linville
@ 2011-05-02  4:34   ` Rajkumar Manoharan
  0 siblings, 0 replies; 3+ messages in thread
From: Rajkumar Manoharan @ 2011-05-02  4:34 UTC (permalink / raw)
  To: John W. Linville
  Cc: Rajkumar Manoharan, linux-wireless@vger.kernel.org,
	stable@kernel.org, Vasanth Thiagarajan

On Sat, Apr 30, 2011 at 12:57:51AM +0530, John W. Linville wrote:
> On Thu, Apr 28, 2011 at 03:31:57PM +0530, Rajkumar Manoharan wrote:
> > 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: stable@kernel.org
> > Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> > Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
> 
> Should this be a fix for 2.6.39?
>
Yes. This patch is meant for 2.6.39 only.

--
Rajkumar

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-02  4:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 10:01 [PATCH] ath9k: Fix drain txq failure in flush Rajkumar Manoharan
2011-04-29 19:27 ` John W. Linville
2011-05-02  4:34   ` Rajkumar Manoharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).