linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwl8k: disable softirqs when accessing sta_notify_list
@ 2010-02-14  3:13 Pavel Roskin
  2010-02-16 20:03 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2010-02-14  3:13 UTC (permalink / raw)
  To: Lennert Buytenhek, linux-wireless, John W. Linville

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.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
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(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 0cfdb9d..6497c84 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -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);
 	}
-- 
Regards,
Pavel Roskin

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mwl8k: disable softirqs when accessing sta_notify_list
  2010-02-14  3:13 [PATCH] mwl8k: disable softirqs when accessing sta_notify_list Pavel Roskin
@ 2010-02-16 20:03 ` Luis R. Rodriguez
  2010-02-16 21:28   ` Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-02-16 20:03 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: Lennert Buytenhek, linux-wireless, John W. Linville

On Sat, Feb 13, 2010 at 7:13 PM, Pavel Roskin <proski@gnu.org> wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mwl8k: disable softirqs when accessing sta_notify_list
  2010-02-16 20:03 ` Luis R. Rodriguez
@ 2010-02-16 21:28   ` Pavel Roskin
  2010-02-17  0:33     ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2010-02-16 21:28 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Lennert Buytenhek, linux-wireless, John W. Linville

On Tue, 2010-02-16 at 12:03 -0800, Luis R. Rodriguez wrote:
> On Sat, Feb 13, 2010 at 7:13 PM, Pavel Roskin <proski@gnu.org> wrote:
> > 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.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mwl8k: disable softirqs when accessing sta_notify_list
  2010-02-16 21:28   ` Pavel Roskin
@ 2010-02-17  0:33     ` John W. Linville
  0 siblings, 0 replies; 4+ messages in thread
From: John W. Linville @ 2010-02-17  0:33 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: Luis R. Rodriguez, Lennert Buytenhek, linux-wireless

On Tue, Feb 16, 2010 at 04:28:32PM -0500, Pavel Roskin wrote:
> On Tue, 2010-02-16 at 12:03 -0800, Luis R. Rodriguez wrote:
> > On Sat, Feb 13, 2010 at 7:13 PM, Pavel Roskin <proski@gnu.org> wrote:
> > > 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
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-17  0:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14  3:13 [PATCH] mwl8k: disable softirqs when accessing sta_notify_list Pavel Roskin
2010-02-16 20:03 ` Luis R. Rodriguez
2010-02-16 21:28   ` Pavel Roskin
2010-02-17  0:33     ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).