summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIdo Yariv <ido@wizery.com>2012-01-11 07:42:40 (GMT)
committerLuciano Coelho <coelho@ti.com>2012-02-15 06:38:28 (GMT)
commita454969ede024a209e6a755d5f7a928ab81ed00c (patch)
tree585296f78c132e320471a0d5acc022fef8fcc288 /drivers
parentf3df1331f25f782e838a3ecb72cec86b539ac02f (diff)
downloadlinux-fsl-qoriq-a454969ede024a209e6a755d5f7a928ab81ed00c.tar.xz
wl12xx: Power off after flushing work
When stopping plt, the chip is powered off before all current work items are flushed and interrupts are disabled. This might introduce a race in which the driver tries to communicate with a powered off chip. Fix this by powering off the device only after interrupts are disabled and all work items are flushed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index ac68664..9e9fb3f 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1406,8 +1406,6 @@ int wl1271_plt_stop(struct wl1271 *wl)
goto out;
}
- wl1271_power_off(wl);
-
wl->state = WL1271_STATE_OFF;
wl->rx_counter = 0;
@@ -1417,6 +1415,11 @@ int wl1271_plt_stop(struct wl1271 *wl)
wl1271_flush_deferred_work(wl);
cancel_work_sync(&wl->netstack_work);
cancel_work_sync(&wl->recovery_work);
+
+ mutex_lock(&wl->mutex);
+ wl1271_power_off(wl);
+ mutex_unlock(&wl->mutex);
+
out:
return ret;
}