aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-13 11:39:53 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-15 03:41:12 -0500
commit65f704a52ec5db356c58f8ba53a31d3aef02737f (patch)
treebc5e0d6388005a74f4becc5ecf83713c8ea744c9
parent441a33baf1805861354fb9e3149c000311b6996f (diff)
mac80211: use spin_lock_bh() for tim_lock
There's no need to use _irqsave() as the lock is never used in interrupt context. This also fixes a problem in the iwlwifi MVM driver that calls spin_unlock_bh() within its set_tim() callback. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/sta_info.c5
-rw-r--r--net/mac80211/tx.c6
2 files changed, 4 insertions, 7 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index fb3b5865fc39..0794b9018ed4 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -571,7 +571,6 @@ void sta_info_recalc_tim(struct sta_info *sta)
571{ 571{
572 struct ieee80211_local *local = sta->local; 572 struct ieee80211_local *local = sta->local;
573 struct ps_data *ps; 573 struct ps_data *ps;
574 unsigned long flags;
575 bool indicate_tim = false; 574 bool indicate_tim = false;
576 u8 ignore_for_tim = sta->sta.uapsd_queues; 575 u8 ignore_for_tim = sta->sta.uapsd_queues;
577 int ac; 576 int ac;
@@ -628,7 +627,7 @@ void sta_info_recalc_tim(struct sta_info *sta)
628 } 627 }
629 628
630 done: 629 done:
631 spin_lock_irqsave(&local->tim_lock, flags); 630 spin_lock_bh(&local->tim_lock);
632 631
633 if (indicate_tim) 632 if (indicate_tim)
634 __bss_tim_set(ps->tim, id); 633 __bss_tim_set(ps->tim, id);
@@ -641,7 +640,7 @@ void sta_info_recalc_tim(struct sta_info *sta)
641 local->tim_in_locked_section = false; 640 local->tim_in_locked_section = false;
642 } 641 }
643 642
644 spin_unlock_irqrestore(&local->tim_lock, flags); 643 spin_unlock_bh(&local->tim_lock);
645} 644}
646 645
647static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb) 646static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f4c89f506e9d..7d8c629f1e6a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2364,11 +2364,9 @@ static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
2364 if (local->tim_in_locked_section) { 2364 if (local->tim_in_locked_section) {
2365 __ieee80211_beacon_add_tim(sdata, ps, skb); 2365 __ieee80211_beacon_add_tim(sdata, ps, skb);
2366 } else { 2366 } else {
2367 unsigned long flags; 2367 spin_lock(&local->tim_lock);
2368
2369 spin_lock_irqsave(&local->tim_lock, flags);
2370 __ieee80211_beacon_add_tim(sdata, ps, skb); 2368 __ieee80211_beacon_add_tim(sdata, ps, skb);
2371 spin_unlock_irqrestore(&local->tim_lock, flags); 2369 spin_unlock(&local->tim_lock);
2372 } 2370 }
2373 2371
2374 return 0; 2372 return 0;