summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-09-29 10:22:59 -0700
committerColin Cross <ccross@android.com>2010-10-04 12:08:01 -0700
commit7e39a212ce79be3865194882393f99e52b2af296 (patch)
tree175ec604f2fc12e6d8cf3eabff0179b2f6282f10
parent461a510e681a298e61492f5f8eb8f3ec79859146 (diff)
net: wireless: bcm4329: Fix setting HT clock race conditions
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--drivers/net/wireless/bcm4329/dhd_linux.c12
-rw-r--r--drivers/net/wireless/bcm4329/dhd_sdio.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c
index 2eff4693d176..f687b31e3338 100644
--- a/drivers/net/wireless/bcm4329/dhd_linux.c
+++ b/drivers/net/wireless/bcm4329/dhd_linux.c
@@ -1379,7 +1379,6 @@ dhd_watchdog_thread(void *data)
/* Run until signal received */
while (1) {
if (down_interruptible (&dhd->watchdog_sem) == 0) {
- dhd_os_wake_lock(&dhd->pub);
if (dhd->pub.dongle_reset == FALSE) {
/* Call the bus module watchdog */
@@ -1387,6 +1386,11 @@ dhd_watchdog_thread(void *data)
}
/* Count the tick for reference */
dhd->pub.tickcnt++;
+
+ /* Reschedule the watchdog */
+ if (dhd->wd_timer_valid)
+ mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
+
dhd_os_wake_unlock(&dhd->pub);
}
else
@@ -1404,12 +1408,6 @@ dhd_watchdog(ulong data)
dhd_os_wake_lock(&dhd->pub);
if (dhd->watchdog_pid >= 0) {
up(&dhd->watchdog_sem);
-
- /* Reschedule the watchdog */
- if (dhd->wd_timer_valid) {
- mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
- }
- dhd_os_wake_unlock(&dhd->pub);
return;
}
diff --git a/drivers/net/wireless/bcm4329/dhd_sdio.c b/drivers/net/wireless/bcm4329/dhd_sdio.c
index bd735568e2ae..176d6e86e764 100644
--- a/drivers/net/wireless/bcm4329/dhd_sdio.c
+++ b/drivers/net/wireless/bcm4329/dhd_sdio.c
@@ -5808,6 +5808,8 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
dhd_os_proto_unblock(dhdp);
/* Expect app to have torn down any connection before calling */
/* Stop the bus, disable F2 */
+ dhd_os_sdlock(dhdp);
+
dhd_bus_stop(bus, FALSE);
/* Clean tx/rx buffer pointers, detach from the dongle */
@@ -5816,6 +5818,8 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
bus->dhd->dongle_reset = TRUE;
bus->dhd->up = FALSE;
+ dhd_os_sdunlock(dhdp);
+
DHD_TRACE(("%s: WLAN OFF DONE\n", __FUNCTION__));
/* App can now remove power from device */
} else