Skip to contentSkip to conversation

mac80211: Fix the wrong WARN_ON message appearing on enabling power save.

PATCH In review Vivek Natarajan 2 participants 4 messages Feb 5, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Fix the wrong WARN_ON message appearing on enabling power save.

The warning message intended to be hit on driver's rejection of a Tx frame is also hit while the netif_subqueue is stopped. This patch fixes this error case.

---
 net/mac80211/tx.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
net/mac80211/tx.c +5 -3
index f1c726d..bf73f6d 100644
@@ -35,6 +35,7 @@
 #define IEEE80211_TX_OK		0
 #define IEEE80211_TX_AGAIN	1
 #define IEEE80211_TX_FRAG_AGAIN	2
+#define IEEE80211_TX_PENDING	3
 
 /* misc utils */
 
@@ -1085,7 +1086,7 @@ static int __ieee80211_tx(struct ieee80211_local *local, struct sk_buff *skb,
 
 	if (skb) {
 		if (netif_subqueue_stopped(local->mdev, skb))
-			return IEEE80211_TX_AGAIN;
+			return IEEE80211_TX_PENDING;
 
 		ret = local->ops->tx(local_to_hw(local), skb);
 		if (ret)
@@ -1211,8 +1212,9 @@ retry:
 		 * queues, there's no reason for a driver to reject
 		 * a frame there, warn and drop it.
 		 */
-		if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
-			goto drop;
+		if (ret != IEEE80211_TX_PENDING)
+			if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
+				goto drop;
 
 		store = &local->pending_packet[queue];
 
Signature · 1 line
1.6.0.1
maintainer
#1 lore raw
Quoted 3 lines · Vivek Natarajan

The warning message intended to be hit on driver's rejection of a Tx frame is also hit while the netif_subqueue is stopped. This patch fixes this error case.

This seems a little odd. Why would we be in that code if the queue is stopped?

Quoted 38 lines
---
 net/mac80211/tx.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
net/mac80211/tx.c +5 -3
index f1c726d..bf73f6d 100644
@@ -35,6 +35,7 @@
 #define IEEE80211_TX_OK		0
 #define IEEE80211_TX_AGAIN	1
 #define IEEE80211_TX_FRAG_AGAIN	2
+#define IEEE80211_TX_PENDING	3
 
 /* misc utils */
 
@@ -1085,7 +1086,7 @@ static int __ieee80211_tx(struct ieee80211_local *local, struct sk_buff *skb,
 
 	if (skb) {
 		if (netif_subqueue_stopped(local->mdev, skb))
-			return IEEE80211_TX_AGAIN;
+			return IEEE80211_TX_PENDING;
 
 		ret = local->ops->tx(local_to_hw(local), skb);
 		if (ret)
@@ -1211,8 +1212,9 @@ retry:
 		 * queues, there's no reason for a driver to reject
 		 * a frame there, warn and drop it.
 		 */
-		if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
-			goto drop;
+		if (ret != IEEE80211_TX_PENDING)
+			if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
+				goto drop;
 
 		store = &local->pending_packet[queue];
 
#2 lore raw
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Vivek Natarajan

The warning message intended to be hit on driver's rejection of a Tx frame is also hit while the netif_subqueue is stopped. This patch fixes this error case.

This seems a little odd. Why would we be in that code if the queue is stopped?

This issue happens only when we are associated with a 11n AP and power save is enabled.
In the function 'ieee80211_master_start_xmit', ps_disable_work is queued where wake_queues is called. But before this work is executed, we check if the queues are stopped in _ieee80211_tx and returned TX_AGAIN to ieee8011_tx which led to the warning message.

Vivek.

maintainer
#3 lore raw
Quoted 9 lines · Vivek Natarajan
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Vivek Natarajan

The warning message intended to be hit on driver's rejection of a Tx frame is also hit while the netif_subqueue is stopped. This patch fixes this error case.

This seems a little odd. Why would we be in that code if the queue is stopped?

Quoted 6 lines

This issue happens only when we are associated with a 11n AP and power save is enabled.
In the function 'ieee80211_master_start_xmit', ps_disable_work is queued where wake_queues is called. But before this work is executed, we check if the queues are stopped in _ieee80211_tx and returned TX_AGAIN to ieee8011_tx which led to the warning message.

Ah, ok, thanks for the explanation. Might make sense to put that into the commit message.

johannes