From: Luciano Coelho <coelho@ti.com>
To: linux-wireless@vger.kernel.org
Cc: coelho@ti.com, Ido Yariv <ido@wizery.com>
Subject: [PATCH 1/8] wl12xx: Acquire lock before stopping plt
Date: Tue, 24 Jan 2012 11:06:22 +0200 [thread overview]
Message-ID: <1327395989-29663-2-git-send-email-coelho@ti.com> (raw)
In-Reply-To: <1327395989-29663-1-git-send-email-coelho@ti.com>
From: Ido Yariv <ido@wizery.com>
__wl1271_plt_stop is called from both wl1271_plt_stop and
wl1271_unregister_hw. While wl1271_plt_stop acquires a mutex,
wl1271_unregister_hw does not.
Fix this by calling wl1271_plt_stop instead of __wl1271_plt_stop from
wl1271_unregister_hw.
Signed-off-by: Ido Yariv <ido@wizery.com>
---
drivers/net/wireless/wl12xx/main.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 915d56c..fc4d4d5 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1391,13 +1391,15 @@ out:
return ret;
}
-static int __wl1271_plt_stop(struct wl1271 *wl)
+int wl1271_plt_stop(struct wl1271 *wl)
{
int ret = 0;
wl1271_notice("power down");
+ mutex_lock(&wl->mutex);
if (wl->state != WL1271_STATE_PLT) {
+ mutex_unlock(&wl->mutex);
wl1271_error("cannot power down because not in PLT "
"state: %d", wl->state);
ret = -EBUSY;
@@ -1410,25 +1412,15 @@ static int __wl1271_plt_stop(struct wl1271 *wl)
wl->rx_counter = 0;
mutex_unlock(&wl->mutex);
+
wl1271_disable_interrupts(wl);
wl1271_flush_deferred_work(wl);
cancel_work_sync(&wl->netstack_work);
cancel_work_sync(&wl->recovery_work);
- mutex_lock(&wl->mutex);
out:
return ret;
}
-int wl1271_plt_stop(struct wl1271 *wl)
-{
- int ret;
-
- mutex_lock(&wl->mutex);
- ret = __wl1271_plt_stop(wl);
- mutex_unlock(&wl->mutex);
- return ret;
-}
-
static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct wl1271 *wl = hw->priv;
@@ -4878,7 +4870,7 @@ static int wl1271_register_hw(struct wl1271 *wl)
static void wl1271_unregister_hw(struct wl1271 *wl)
{
if (wl->state == WL1271_STATE_PLT)
- __wl1271_plt_stop(wl);
+ wl1271_plt_stop(wl);
unregister_netdevice_notifier(&wl1271_dev_notifier);
ieee80211_unregister_hw(wl->hw);
--
1.7.4.1
next prev parent reply other threads:[~2012-01-24 9:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 9:06 [PATCH 0/8] wl12xx: some fixes and improvements for PLT mode Luciano Coelho
2012-01-24 9:06 ` Luciano Coelho [this message]
2012-01-24 9:06 ` [PATCH 2/8] wl12xx: Power off after flushing work Luciano Coelho
2012-01-24 9:06 ` [PATCH 3/8] wl12xx: Fix potential interrupt storm Luciano Coelho
2012-01-24 9:06 ` [PATCH 4/8] wl12xx: cancel delayed elp work and clear flags when stopping PLT Luciano Coelho
2012-01-24 9:06 ` [PATCH 5/8] wl12xx: move partition table definition to io.c Luciano Coelho
2012-01-24 9:06 ` [PATCH 6/8] wl12xx: read chip ID and HW PG version during probe Luciano Coelho
2012-01-24 9:06 ` [PATCH 7/8] wl12xx: use two MAC addresses based on the NVS or from fuse ROM Luciano Coelho
2012-01-24 9:06 ` [PATCH 8/8] wl12xx: add testmode operation to read the BD_ADDR from Fuse ROM Luciano Coelho
2012-02-15 10:12 ` [PATCH 0/8] wl12xx: some fixes and improvements for PLT mode Luciano Coelho
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=1327395989-29663-2-git-send-email-coelho@ti.com \
--to=coelho@ti.com \
--cc=ido@wizery.com \
--cc=linux-wireless@vger.kernel.org \
/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