Commit 65f704a5 authored by Johannes Berg's avatar Johannes Berg

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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 441a33ba
...@@ -571,7 +571,6 @@ void sta_info_recalc_tim(struct sta_info *sta) ...@@ -571,7 +571,6 @@ void sta_info_recalc_tim(struct sta_info *sta)
{ {
struct ieee80211_local *local = sta->local; struct ieee80211_local *local = sta->local;
struct ps_data *ps; struct ps_data *ps;
unsigned long flags;
bool indicate_tim = false; bool indicate_tim = false;
u8 ignore_for_tim = sta->sta.uapsd_queues; u8 ignore_for_tim = sta->sta.uapsd_queues;
int ac; int ac;
...@@ -628,7 +627,7 @@ void sta_info_recalc_tim(struct sta_info *sta) ...@@ -628,7 +627,7 @@ void sta_info_recalc_tim(struct sta_info *sta)
} }
done: done:
spin_lock_irqsave(&local->tim_lock, flags); spin_lock_bh(&local->tim_lock);
if (indicate_tim) if (indicate_tim)
__bss_tim_set(ps->tim, id); __bss_tim_set(ps->tim, id);
...@@ -641,7 +640,7 @@ void sta_info_recalc_tim(struct sta_info *sta) ...@@ -641,7 +640,7 @@ void sta_info_recalc_tim(struct sta_info *sta)
local->tim_in_locked_section = false; local->tim_in_locked_section = false;
} }
spin_unlock_irqrestore(&local->tim_lock, flags); spin_unlock_bh(&local->tim_lock);
} }
static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb) static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb)
......
...@@ -2364,11 +2364,9 @@ static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata, ...@@ -2364,11 +2364,9 @@ static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
if (local->tim_in_locked_section) { if (local->tim_in_locked_section) {
__ieee80211_beacon_add_tim(sdata, ps, skb); __ieee80211_beacon_add_tim(sdata, ps, skb);
} else { } else {
unsigned long flags; spin_lock(&local->tim_lock);
spin_lock_irqsave(&local->tim_lock, flags);
__ieee80211_beacon_add_tim(sdata, ps, skb); __ieee80211_beacon_add_tim(sdata, ps, skb);
spin_unlock_irqrestore(&local->tim_lock, flags); spin_unlock(&local->tim_lock);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment