From: Johannes Berg Date: Thu, 24 Nov 2011 13:47:36 +0000 (+0100) Subject: mac80211: fix TX warning X-Git-Tag: v3.3-rc1~182^2~261^2~107 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=4db4e0a17fb0e7b345b344cde141b252794c2f19;p=~emulex%2Finfiniband.git mac80211: fix TX warning Emmanuel reported that my previous patches to enable handing all fragments to drivers at once triggered the warning that the SKB queue wasn't empty. This is happening when we actually queue up some frames and don't hand them to the driver (queues are stopped). The reason for it is that my code that splices the frame(s) over to the pending queue didn't re-init the local queue, so skb_queue_empty() was false. Fix this by using the _init versions of the splicing. Also, convert the warning to WARN_ON_ONCE. Reported-by: Emmanuel Grumbach Signed-off-by: Johannes Berg Tested-by: Emmanuel Grumbach Signed-off-by: John W. Linville --- diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 68cbd009542..6fad8fac378 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1227,9 +1227,10 @@ static bool ieee80211_tx_frags(struct ieee80211_local *local, * queue is woken again. */ if (txpending) - skb_queue_splice(skbs, &local->pending[q]); + skb_queue_splice_init(skbs, &local->pending[q]); else - skb_queue_splice_tail(skbs, &local->pending[q]); + skb_queue_splice_tail_init(skbs, + &local->pending[q]); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); @@ -1301,7 +1302,7 @@ static bool __ieee80211_tx(struct ieee80211_local *local, ieee80211_tpt_led_trig_tx(local, fc, led_len); ieee80211_led_tx(local, 1); - WARN_ON(!skb_queue_empty(skbs)); + WARN_ON_ONCE(!skb_queue_empty(skbs)); return result; }