net: wireless: bcmdhd: Postpone taking wd_wake lock
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 18 Dec 2012 22:43:34 +0000 (14:43 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Tue, 18 Dec 2012 22:43:34 +0000 (14:43 -0800)
Change-Id: I3926d7a1a357d173144f408996f35f0929db711e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c

index bf6d85554edece801d66c5bf7f9d096279934637..9e9f5b62a427b28deef58d1bd0b8b8a13426eb60 100644 (file)
@@ -3991,15 +3991,13 @@ dhd_os_wd_timer(void *bus, uint wdtick)
        if (!dhd)
                return;
 
-       if (wdtick)
-               DHD_OS_WD_WAKE_LOCK(pub);
-
        flags = dhd_os_spin_lock(pub);
 
        /* don't start the wd until fw is loaded */
        if (pub->busstate == DHD_BUS_DOWN) {
                dhd_os_spin_unlock(pub, flags);
-               DHD_OS_WD_WAKE_UNLOCK(pub);
+               if (!wdtick)
+                       DHD_OS_WD_WAKE_UNLOCK(pub);
                return;
        }
 
@@ -4017,6 +4015,7 @@ dhd_os_wd_timer(void *bus, uint wdtick)
        }
 
        if (wdtick) {
+               DHD_OS_WD_WAKE_LOCK(pub);
                dhd_watchdog_ms = (uint)wdtick;
                /* Re arm the timer, at last watchdog period */
                mod_timer(&dhd->timer, jiffies + msecs_to_jiffies(dhd_watchdog_ms));