linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: incorrect queue may be stopped/awaken
@ 2015-11-03 17:37 Borja Salazar
  2015-11-12 19:57 ` Kalle Valo
  2015-11-13  6:31 ` Janusz Dziedzic
  0 siblings, 2 replies; 8+ messages in thread
From: Borja Salazar @ 2015-11-03 17:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath9k-devel, Borja Salazar

When channel context is enabled, we could be
stopping/awakening an incorrect queue.
---
 drivers/net/wireless/ath/ath9k/xmit.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3e3dac3..9b17a59 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -147,7 +147,12 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
 {
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ath_frame_info *fi = get_frame_info(skb);
-	int q = fi->txq;
+	int q;
+
+	if (ath9k_is_chanctx_enabled())
+		q = fi->txq;
+	else
+		q = info->hw_queue;
 
 	if (q < 0)
 		return;
@@ -158,10 +163,7 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
 
 	if (txq->stopped &&
 	    txq->pending_frames < sc->tx.txq_max_pending[q]) {
-		if (ath9k_is_chanctx_enabled())
-			ieee80211_wake_queue(sc->hw, info->hw_queue);
-		else
-			ieee80211_wake_queue(sc->hw, q);
+		ieee80211_wake_queue(sc->hw, q);
 		txq->stopped = false;
 	}
 }
@@ -2299,17 +2301,17 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 	 * info are no longer valid (overwritten by the ath_frame_info data.
 	 */
 
-	q = skb_get_queue_mapping(skb);
+	if (ath9k_is_chanctx_enabled())
+		q = skb_get_queue_mapping(skb);
+	else
+		q = info->hw_queue;
 
 	ath_txq_lock(sc, txq);
 	if (txq == sc->tx.txq_map[q]) {
 		fi->txq = q;
 		if (++txq->pending_frames > sc->tx.txq_max_pending[q] &&
 		    !txq->stopped) {
-			if (ath9k_is_chanctx_enabled())
-				ieee80211_stop_queue(sc->hw, info->hw_queue);
-			else
-				ieee80211_stop_queue(sc->hw, q);
+			ieee80211_stop_queue(sc->hw, q);
 			txq->stopped = true;
 		}
 	}
-- 
2.3.6


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

end of thread, other threads:[~2015-11-13 11:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 17:37 [PATCH] ath9k: incorrect queue may be stopped/awaken Borja Salazar
2015-11-12 19:57 ` Kalle Valo
2015-11-13  6:31 ` Janusz Dziedzic
2015-11-13 10:33   ` [PATCH v2] " Borja Salazar
2015-11-13 10:49     ` Borja Salazar
2015-11-13 11:37       ` Kalle Valo
     [not found]     ` <CADqurOGEoZ15BtcqLwQGXLoBJLUCcd6ciypuYBzVjJb7MAHYng@mail.gmail.com>
     [not found]       ` <CALhHN=qB-Hmr60CLyS-eV_Vx1bWL5YLP2VQ0ipV5Okphyd-OiA@mail.gmail.com>
2015-11-13 11:19         ` Janusz Dziedzic
2015-11-13 11:27           ` Borja Salazar

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).