linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: detect driver tx bugs
@ 2008-06-15 12:47 Johannes Berg
  2008-06-15 12:55 ` [PATCH v2] " Johannes Berg
  2008-06-15 13:49 ` [PATCH] " Johannes Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Johannes Berg @ 2008-06-15 12:47 UTC (permalink / raw)
  To: John Linville; +Cc: Rafael J. Wysocki, Michael Buesch, linux-wireless

When a driver rejects a frame in it's ->tx() callback, it must also
stop queues, otherwise mac80211 can go into a loop here. Detect this
situation and abort the loop after five retries, warning about the
driver bug.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
This fixes resume with connected device with b43 for me, the warning
triggers.

 net/mac80211/tx.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- everything.orig/net/mac80211/tx.c	2008-06-15 14:19:10.000000000 +0200
+++ everything/net/mac80211/tx.c	2008-06-15 14:21:06.000000000 +0200
@@ -1091,7 +1091,7 @@ static int ieee80211_tx(struct net_devic
 	struct ieee80211_tx_data tx;
 	ieee80211_tx_result res = TX_DROP, res_prepare;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-	int ret, i;
+	int ret, i, retries = 0;
 	u16 queue;
 
 	queue = skb_get_queue_mapping(skb);
@@ -1189,6 +1189,13 @@ retry:
 		 */
 		if (!__netif_subqueue_stopped(local->mdev, queue)) {
 			clear_bit(queue, local->queues_pending);
+			retries++;
+			/*
+			 * Driver bug, it's rejecting packets but
+			 * not stopping queues.
+			 */
+			if (WARN_ON(retries > 5))
+				goto drop;
 			goto retry;
 		}
 		store->skb = skb;



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

end of thread, other threads:[~2008-06-18 22:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-15 12:47 [PATCH] mac80211: detect driver tx bugs Johannes Berg
2008-06-15 12:55 ` [PATCH v2] " Johannes Berg
2008-06-16  1:17   ` Rafael J. Wysocki
2008-06-16 23:23   ` Rafael J. Wysocki
2008-06-17  6:56   ` [PATCH 2.6.26] " Johannes Berg
     [not found]   ` <1213785045.1312.12.camel@johannes.berg>
2008-06-18 20:37     ` [PATCH 2.6.26 (resend)] " John W. Linville
2008-06-18 22:38       ` David Miller
2008-06-18 22:40     ` David Miller
2008-06-15 13:49 ` [PATCH] " Johannes Berg

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