* Re: [PATCH v2] mac80211: detect driver tx bugs
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
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2008-06-16 1:17 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Michael Buesch, linux-wireless
On Sunday, 15 of June 2008, Johannes Berg wrote:
> 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>
I'm unable to test this patch at the moment, because suspend is broken with
linux-next on my box. Tomorrow I'll try to find out why.
Thanks,
Rafael
> ---
> v2: Michael suggested to use WARN_ON_ONCE instead
>
> 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:53:52.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_ONCE(retries > 5))
> + goto drop;
> goto retry;
> }
> store->skb = skb;
>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2] mac80211: detect driver tx bugs
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>
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2008-06-16 23:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Michael Buesch, linux-wireless
On Sunday, 15 of June 2008, Johannes Berg wrote:
> 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>
The patch forks for me nicely. :-)
I'm now able to hibernate the box without turning off the b43 wireless.
Thanks a lot,
Rafael
> ---
> v2: Michael suggested to use WARN_ON_ONCE instead
>
> 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:53:52.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_ONCE(retries > 5))
> + goto drop;
> goto retry;
> }
> store->skb = skb;
>
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 2.6.26] mac80211: detect driver tx bugs
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 ` Johannes Berg
[not found] ` <1213785045.1312.12.camel@johannes.berg>
3 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-06-17 6:56 UTC (permalink / raw)
To: John Linville
Cc: Rafael J. Wysocki, Michael Buesch, linux-wireless,
David S. Miller
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 is a port of the patch to 2.6.26 which seems to suffer from the
same problem and could well be the cause of all the mac80211 softlockup
warnings on kerneloops.org.
Dave, with John on vacation until the 22nd, would you push this to Linu=
s
with the next net update instead of it going through John's tree first?
Ideally we'd fix the driver bugs, but that'd need an audit and this at
least lets the system continue and work, a b43 bugfix was posted too to
just drop frames if they come in at inopportune times.
net/mac80211/tx.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a=EF=BB=BF/net/mac80211/tx.c 2008-06-17 08:45:25.096294488 +0200
+++ b/=EF=BB=BFnet/mac80211/tx.c 2008-06-17 08:47:02.106291721 +0200
@@ -1132,7 +1132,7 @@ static int ieee80211_tx(struct net_devic
ieee80211_tx_handler *handler;
struct ieee80211_tx_data tx;
ieee80211_tx_result res =3D TX_DROP, res_prepare;
- int ret, i;
+ int ret, i, retries =3D 0;
=20
WARN_ON(__ieee80211_queue_pending(local, control->queue));
=20
@@ -1216,6 +1216,13 @@ retry:
if (!__ieee80211_queue_stopped(local, control->queue)) {
clear_bit(IEEE80211_LINK_STATE_PENDING,
&local->state[control->queue]);
+ retries++;
+ /*
+ * Driver bug, it's rejecting packets but
+ * not stopping queues.
+ */
+ if (WARN_ON_ONCE(retries > 5))
+ goto drop;
goto retry;
}
memcpy(&store->control, control,
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread[parent not found: <1213785045.1312.12.camel@johannes.berg>]
* Re: [PATCH 2.6.26 (resend)] mac80211: detect driver tx bugs
[not found] ` <1213785045.1312.12.camel@johannes.berg>
@ 2008-06-18 20:37 ` John W. Linville
2008-06-18 22:38 ` David Miller
2008-06-18 22:40 ` David Miller
1 sibling, 1 reply; 9+ messages in thread
From: John W. Linville @ 2008-06-18 20:37 UTC (permalink / raw)
To: Johannes Berg
Cc: Rafael J. Wysocki, Michael Buesch, linux-wireless,
David S. Miller
On Wed, Jun 18, 2008 at 12:30:45PM +0200, Johannes Berg wrote:
> 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 is a port of the patch to 2.6.26 which seems to suffer from the
> same problem and could well be the cause of some of the mac80211 softlockup
> warnings on kerneloops.org.
>
> Dave, with John on vacation until the 22nd, would you push this to Linus
> with the next net update instead of it going through John's tree first?
This is fine with me. Otherwise I'll try to get to it in the next
day or so.
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 2.6.26 (resend)] mac80211: detect driver tx bugs
2008-06-18 20:37 ` [PATCH 2.6.26 (resend)] " John W. Linville
@ 2008-06-18 22:38 ` David Miller
0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2008-06-18 22:38 UTC (permalink / raw)
To: linville; +Cc: johannes, rjw, mb, linux-wireless
From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 18 Jun 2008 16:37:14 -0400
> On Wed, Jun 18, 2008 at 12:30:45PM +0200, Johannes Berg wrote:
> > 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 is a port of the patch to 2.6.26 which seems to suffer from the
> > same problem and could well be the cause of some of the mac80211 softlockup
> > warnings on kerneloops.org.
> >
> > Dave, with John on vacation until the 22nd, would you push this to Linus
> > with the next net update instead of it going through John's tree first?
>
> This is fine with me. Otherwise I'll try to get to it in the next
> day or so.
I'll toss it into my tree, don't worry about it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2.6.26 (resend)] mac80211: detect driver tx bugs
[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:40 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2008-06-18 22:40 UTC (permalink / raw)
To: johannes; +Cc: linville, rjw, mb, linux-wireless
From: Johannes Berg <johannes@sipsolutions.net>
Date: Wed, 18 Jun 2008 12:30:45 +0200
> 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 is a port of the patch to 2.6.26 which seems to suffer from the
> same problem and could well be the cause of some of the mac80211 softlockup
> warnings on kerneloops.org.
>
> Dave, with John on vacation until the 22nd, would you push this to Linus
> with the next net update instead of it going through John's tree first?
I've applied this to net-2.6, thanks.
I'm going to give Linus a little bit more time to take in the
pull request I sent last night before I push this to kernel.org,
so don't panic if it doesn't show up for a bit :)
^ permalink raw reply [flat|nested] 9+ messages in thread