aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-11-24 08:47:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:43:56 -0500
commit4db4e0a17fb0e7b345b344cde141b252794c2f19 (patch)
tree13ce0ef31d02d0dafb377e510dda0e4be5b6fbe1 /net/mac80211
parent4883993841638963fbae2f334899f29309466152 (diff)
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 <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c7
1 files changed, 4 insertions, 3 deletions
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,
1227 * queue is woken again. 1227 * queue is woken again.
1228 */ 1228 */
1229 if (txpending) 1229 if (txpending)
1230 skb_queue_splice(skbs, &local->pending[q]); 1230 skb_queue_splice_init(skbs, &local->pending[q]);
1231 else 1231 else
1232 skb_queue_splice_tail(skbs, &local->pending[q]); 1232 skb_queue_splice_tail_init(skbs,
1233 &local->pending[q]);
1233 1234
1234 spin_unlock_irqrestore(&local->queue_stop_reason_lock, 1235 spin_unlock_irqrestore(&local->queue_stop_reason_lock,
1235 flags); 1236 flags);
@@ -1301,7 +1302,7 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
1301 ieee80211_tpt_led_trig_tx(local, fc, led_len); 1302 ieee80211_tpt_led_trig_tx(local, fc, led_len);
1302 ieee80211_led_tx(local, 1); 1303 ieee80211_led_tx(local, 1);
1303 1304
1304 WARN_ON(!skb_queue_empty(skbs)); 1305 WARN_ON_ONCE(!skb_queue_empty(skbs));
1305 1306
1306 return result; 1307 return result;
1307} 1308}