From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: wey-yi.w.guy@intel.com, linux-wireless@vger.kernel.org,
Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 2/2] mac80211: fix scan locking wrt. hw scan
Date: Fri, 30 Jul 2010 13:30:47 +0200 [thread overview]
Message-ID: <20100730113152.340700184@sipsolutions.net> (raw)
In-Reply-To: 20100730113045.923567583@sipsolutions.net
From: Johannes Berg <johannes.berg@intel.com>
Releasing the scan mutex while starting scans
can lead to unexpected things happening, so
we shouldn't do that. Fix that and hold the
mutex across the scan triggering.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/scan.c | 14 --------------
1 file changed, 14 deletions(-)
--- wireless-testing.orig/net/mac80211/scan.c 2010-07-30 08:43:30.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c 2010-07-30 08:43:38.000000000 +0200
@@ -401,19 +401,7 @@ static int __ieee80211_start_scan(struct
else
__set_bit(SCAN_SW_SCANNING, &local->scanning);
- /*
- * Kicking off the scan need not be protected,
- * only the scan variable stuff, since now
- * local->scan_req is assigned and other callers
- * will abort their scan attempts.
- *
- * This avoids too many locking dependencies
- * so that the scan completed calls have more
- * locking freedom.
- */
-
ieee80211_recalc_idle(local);
- mutex_unlock(&local->scan_mtx);
if (local->ops->hw_scan) {
WARN_ON(!ieee80211_prep_hw_scan(local));
@@ -421,8 +409,6 @@ static int __ieee80211_start_scan(struct
} else
rc = ieee80211_start_sw_scan(local);
- mutex_lock(&local->scan_mtx);
-
if (rc) {
kfree(local->hw_scan_req);
local->hw_scan_req = NULL;
next prev parent reply other threads:[~2010-07-30 12:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 11:30 [PATCH 0/2] hw scan fixes Johannes Berg
2010-07-30 11:30 ` [PATCH 1/2] iwlwifi: fix possible recursive locking deadlock Johannes Berg
2010-07-30 11:30 ` Johannes Berg [this message]
2010-07-30 12:14 ` [PATCH 0/2] hw scan fixes Johannes Berg
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=20100730113152.340700184@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=wey-yi.w.guy@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.