aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-01-12 07:40:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-13 15:46:45 -0500
commit681c4d07dd5b2ce2ad9f6dbbf7841e479fbc7754 (patch)
tree095ffe7e63cc61951095b5642a38136557502a21 /net/mac80211/main.c
parent8d661f1e462d50bd83de87ee628aaf820ce3c66c (diff)
mac80211: fix lockdep warning
Since the introduction of the fixes for the reorder timer, mac80211 will cause lockdep warnings because lockdep confuses local->skb_queue and local->rx_skb_queue and treats their lock as the same. However, their locks are different, and are valid in different contexts (the former is used in IRQ context, the latter in BH only) and the only thing to be done is mark the former as a different lock class so that lockdep can tell the difference. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: Sujith <m.sujith@gmail.com> Reported-by: Miles Lane <miles.lane@gmail.com> Tested-by: Sujith <m.sujith@gmail.com> Tested-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 485d36bc9a46..a46ff06d7cb8 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -39,6 +39,8 @@ module_param(ieee80211_disable_40mhz_24ghz, bool, 0644);
39MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, 39MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz,
40 "Disable 40MHz support in the 2.4GHz band"); 40 "Disable 40MHz support in the 2.4GHz band");
41 41
42static struct lock_class_key ieee80211_rx_skb_queue_class;
43
42void ieee80211_configure_filter(struct ieee80211_local *local) 44void ieee80211_configure_filter(struct ieee80211_local *local)
43{ 45{
44 u64 mc; 46 u64 mc;
@@ -569,7 +571,15 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
569 spin_lock_init(&local->filter_lock); 571 spin_lock_init(&local->filter_lock);
570 spin_lock_init(&local->queue_stop_reason_lock); 572 spin_lock_init(&local->queue_stop_reason_lock);
571 573
572 skb_queue_head_init(&local->rx_skb_queue); 574 /*
575 * The rx_skb_queue is only accessed from tasklets,
576 * but other SKB queues are used from within IRQ
577 * context. Therefore, this one needs a different
578 * locking class so our direct, non-irq-safe use of
579 * the queue's lock doesn't throw lockdep warnings.
580 */
581 skb_queue_head_init_class(&local->rx_skb_queue,
582 &ieee80211_rx_skb_queue_class);
573 583
574 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); 584 INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work);
575 585