From: Luciano Coelho <luciano.coelho@nokia.com>
To: ext Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Stanislaw Gruszka <sgruszka@redhat.com>,
Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 3/3] wl12xx: remove unneeded locking
Date: Tue, 31 Aug 2010 09:23:39 +0300 [thread overview]
Message-ID: <1283235819.2945.1.camel@powerslave> (raw)
In-Reply-To: <20100826113438.826909320@sipsolutions.net>
On Thu, 2010-08-26 at 13:30 +0200, ext Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> With the scan callback now being callable from
> any context, these unlocks/locks can go away.
> This makes the code easier to understand, since
> callers of these functions must no longer be
> aware that the mutex may be dropped.
>
> As Stanislaw is working on iwlwifi scanning, I
> didn't change it to take advantage of the new
> mac80211 semantics.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
[...]
> --- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1271_main.c 2010-08-26 13:29:57.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/wl12xx/wl1271_main.c 2010-08-26 13:30:03.000000000 +0200
> @@ -948,9 +948,7 @@ static void wl1271_op_remove_interface(s
> ieee80211_enable_dyn_ps(wl->vif);
>
> if (wl->scan.state != WL1271_SCAN_STATE_IDLE) {
> - mutex_unlock(&wl->mutex);
> ieee80211_scan_completed(wl->hw, true);
> - mutex_lock(&wl->mutex);
> wl->scan.state = WL1271_SCAN_STATE_IDLE;
> kfree(wl->scan.scanned_ch);
> wl->scan.scanned_ch = NULL;
> --- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1271_scan.c 2010-08-26 13:29:57.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/wl12xx/wl1271_scan.c 2010-08-26 13:30:03.000000000 +0200
> @@ -215,9 +215,7 @@ void wl1271_scan_stm(struct wl1271 *wl)
> break;
>
> case WL1271_SCAN_STATE_DONE:
> - mutex_unlock(&wl->mutex);
> ieee80211_scan_completed(wl->hw, false);
> - mutex_lock(&wl->mutex);
>
> kfree(wl->scan.scanned_ch);
> wl->scan.scanned_ch = NULL;
Yes, the wl1271 part also looks good. This definitely simplifies things
and makes the code more robust.
--
Cheers,
Luca.
prev parent reply other threads:[~2010-08-31 6:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 11:30 [PATCH 0/3] some scan patches Johannes Berg
2010-08-26 11:30 ` [PATCH 1/3] mac80211: remove unused scan expire define Johannes Berg
2010-08-26 11:30 ` [PATCH 2/3] mac80211: allow scan to complete from any context Johannes Berg
2010-08-26 11:30 ` [PATCH 3/3] wl12xx: remove unneeded locking Johannes Berg
2010-08-28 6:22 ` Kalle Valo
2010-08-31 6:23 ` Luciano Coelho [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=1283235819.2945.1.camel@powerslave \
--to=luciano.coelho@nokia.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sgruszka@redhat.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;
as well as URLs for NNTP newsgroup(s).