Skip to contentSkip to conversation

mwl8k: disable softirqs when accessing sta_notify_list

PATCH In review Pavel Roskin 3 participants 4 messages Feb 14, 2010 – Feb 17, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwl8k: disable softirqs when accessing sta_notify_list

Use spin_[un]lock_bh in mwl8k_sta_notify(). The sta_notify handler is required to be atomic, yet it can be called in process context, so make sure one call won't preempt another.

---
I found it by accident (sparse reported it, but presumably for a wrong reason) and I have no hardware to test the patch on, but I believe it's correct.

 drivers/net/wireless/mwl8k.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mwl8k.c +2 -2
index 0cfdb9d..6497c84 100644
@@ -3784,9 +3784,9 @@ mwl8k_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		s->cmd = cmd;
 		s->sta = *sta;
 
-		spin_lock(&priv->sta_notify_list_lock);
+		spin_lock_bh(&priv->sta_notify_list_lock);
 		list_add_tail(&s->list, &priv->sta_notify_list);
-		spin_unlock(&priv->sta_notify_list_lock);
+		spin_unlock_bh(&priv->sta_notify_list_lock);
 
 		ieee80211_queue_work(hw, &priv->sta_notify_worker);
 	}
Signature · 2 lines
Regards,
Pavel Roskin
#1 lore raw
Quoted 3 lines · Pavel Roskin

Use spin_[un]lock_bh in mwl8k_sta_notify().  The sta_notify handler is required to be atomic, yet it can be called in process context, so make sure one call won't preempt another.

Is this for stable as well?

Luis

#2 lore raw
Quoted 6 lines · Luis R. Rodriguez
Quoted 3 lines · Pavel Roskin

Use spin_[un]lock_bh in mwl8k_sta_notify(). The sta_notify handler is required to be atomic, yet it can be called in process context, so make sure one call won't preempt another.

Is this for stable as well?

Since it wasn't tested on real hardware, I would say no, unless Lennert says otherwise.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw
Quoted 10 lines · Pavel Roskin
Quoted 6 lines · Luis R. Rodriguez
Quoted 3 lines · Pavel Roskin

Use spin_[un]lock_bh in mwl8k_sta_notify(). The sta_notify handler is required to be atomic, yet it can be called in process context, so make sure one call won't preempt another.

Is this for stable as well?

Since it wasn't tested on real hardware, I would say no, unless Lennert says otherwise.

That's how I saw it as well.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.