Not only during probe but also during release, there is lock
inversion. Remove those lock inversions to fix possible deadlock.
Note: during dhdsdio_probe(), there is still lock inversion
missed from the commit
cd03083b2410 ("bcmdhd: fix possible
deadlock during dhdsdio_probe()").
Change-Id: I8c1fb82c3ebaa7ccf58c1e01c94b1d005df42179
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
goto fail;
}
+ DHD_MUTEX_UNLOCK();
+
/* Attach to the dhd/OS/network interface */
if (!(bus->dhd = dhd_attach(osh, bus, SDPCM_RESERVE))) {
DHD_ERROR(("%s: dhd_attach failed\n", __FUNCTION__));
+ DHD_MUTEX_LOCK();
goto fail;
}
+
+ DHD_MUTEX_LOCK();
+
#if defined(BT_OVER_SDIO)
g_dhd_pub = bus->dhd;
DHD_ERROR(("%s: g_dhd_pub %p\n", __FUNCTION__, g_dhd_pub));
if (bus->dhd) {
dongle_isolation = bus->dhd->dongle_isolation;
+ DHD_MUTEX_UNLOCK();
dhd_detach(bus->dhd);
+ DHD_MUTEX_LOCK();
}
/* De-register interrupt handler */