]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
net: wireless: bcmdhd: reorder sdlock to avoid lockup
authorAllen Yu <alleny@nvidia.com>
Tue, 8 Jul 2014 17:21:21 +0000 (01:21 +0800)
committerTodd Poynter <tpoynter@nvidia.com>
Wed, 9 Jul 2014 18:12:40 +0000 (11:12 -0700)
dhd_os_sdlock() is called in dhd_watchdog(), which is the timer function
of dhd->timer. So we need to release the lock before deleting the timer
to avoid cpu lockup.

bug 1526837

Change-Id: Icbeb393afe81ff476d0e133f60bc7b0477d37364
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/435684
Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
drivers/net/wireless/bcmdhd/dhd_linux.c

index dd503ad35ab4926c10e8477e7da9a397d8fa04e7..b78163233f4207aded66876880cf1334af53dd50 100644 (file)
@@ -3701,13 +3701,13 @@ dhd_bus_start(dhd_pub_t *dhdp)
                flags = dhd_os_spin_lock(&dhd->pub);
                dhd->wd_timer_valid = FALSE;
                dhd_os_spin_unlock(&dhd->pub, flags);
-               del_timer_sync(&dhd->timer);
-
-               DHD_ERROR(("%s Host failed to register for OOB\n", __FUNCTION__));
 #ifdef DHDTHREAD
                if (dhd->threads_only)
                        dhd_os_sdunlock(dhdp);
 #endif /* DHDTHREAD */
+
+               del_timer_sync(&dhd->timer);
+               DHD_ERROR(("%s Host failed to register for OOB\n", __FUNCTION__));
                DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
                return -ENODEV;
        }
@@ -3721,12 +3721,13 @@ dhd_bus_start(dhd_pub_t *dhdp)
                flags = dhd_os_spin_lock(&dhd->pub);
                dhd->wd_timer_valid = FALSE;
                dhd_os_spin_unlock(&dhd->pub, flags);
-               del_timer_sync(&dhd->timer);
-               DHD_ERROR(("%s failed bus is not ready\n", __FUNCTION__));
 #ifdef DHDTHREAD
                if (dhd->threads_only)
                        dhd_os_sdunlock(dhdp);
 #endif /* DHDTHREAD */
+
+               del_timer_sync(&dhd->timer);
+               DHD_ERROR(("%s failed bus is not ready\n", __FUNCTION__));
                DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
                return -ENODEV;
        }