Linux wireless drivers development
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@suse.cz>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: seventh guardian <seventhguardian@gmail.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: d80211 deadlock with wpa_supplicant and rmmod
Date: Sat, 14 Jul 2007 15:24:14 +0200	[thread overview]
Message-ID: <20070714152414.0d9d00ea@logostar.upir.cz> (raw)
In-Reply-To: <1184363116.3928.4.camel@johannes.berg>

On Fri, 13 Jul 2007 23:45:16 +0200, Johannes Berg wrote:
> On Fri, 2007-07-13 at 13:05 +0100, seventh guardian wrote:
> 
> > Hello, sorry for the delay but I only managed to try it out today..
> > I've applied the patch and tortured the system as far as I could, and
> > no hang at all :)
> > 
> > I've read the thread and it apparently replaces one bad problem for a
> > lesser one, so I understand if it's not applied.. But at least there
> > is a place in the code to point as the culprit :)
> 
> It definitely should be applied anyway :) I guess John just hasn't
> caught up with all threads yet.

That's my fault, I missed that patch. If everybody put [PATCH] to subject
of mails containing a patch... (sigh)

> John: This is about the patch in the "mac80211/bcm43xx deadlock" thread
> from Michael, it kills some rtnl_lock()/unlock() that causes this
> deadlock.

Yes, please apply (the patch is below). Of course, we'll need a proper fix
but until it is ready this should be applied to prevent deadlocks.

Thanks,

 Jiri

---

Subject: [PATCH] mac80211: remove rtnl locking in ieee80211_sta.c
From: Michael Wu <flamingice@sourmilk.net>

The rtnl is held in ieee80211_sta.c to prevent some potential races with
userspace. Unfortunately, it also has the potential for deadlocks on
interface down. This patch removes the rtnl locking to eliminate the
deadlocks.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>
---

 net/mac80211/ieee80211_sta.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 91b545c..4862797 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -25,7 +25,6 @@
 #include <linux/wireless.h>
 #include <linux/random.h>
 #include <linux/etherdevice.h>
-#include <linux/rtnetlink.h>
 #include <net/iw_handler.h>
 #include <asm/types.h>
 
@@ -2073,12 +2072,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
 	struct ieee80211_sta_bss *bss, *selected = NULL;
 	int top_rssi = 0, freq;
 
-	rtnl_lock();
-
 	if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel &&
 	    !ifsta->auto_ssid_sel) {
 		ifsta->state = IEEE80211_AUTHENTICATE;
-		rtnl_unlock();
 		ieee80211_sta_reset_auth(dev, ifsta);
 		return 0;
 	}
@@ -2121,7 +2117,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
 		ieee80211_sta_set_bssid(dev, selected->bssid);
 		ieee80211_rx_bss_put(dev, selected);
 		ifsta->state = IEEE80211_AUTHENTICATE;
-		rtnl_unlock();
 		ieee80211_sta_reset_auth(dev, ifsta);
 		return 0;
 	} else {
@@ -2132,7 +2127,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
 		} else
 			ifsta->state = IEEE80211_DISABLED;
 	}
-	rtnl_unlock();
 	return -1;
 }
 

-- 
Jiri Benc
SUSE Labs

      reply	other threads:[~2007-07-14 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1caff7430707111617o70a534a5x2cf6b611a91f301a@mail.gmail.com>
2007-07-11 23:41 ` d80211 deadlock with wpa_supplicant and rmmod John W. Linville
2007-07-12  2:20   ` seventh guardian
2007-07-12 10:02   ` Johannes Berg
2007-07-13 12:05     ` seventh guardian
2007-07-13 21:45       ` Johannes Berg
2007-07-14 13:24         ` Jiri Benc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070714152414.0d9d00ea@logostar.upir.cz \
    --to=jbenc@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=seventhguardian@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox