diff options
| author | Mukul Sharma <mukul@qti.qualcomm.com> | 2016-06-06 16:41:50 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-06-23 16:31:53 +0530 |
| commit | 8484a2e84d05ddfdca16e66e09d6eee1bd74cd1a (patch) | |
| tree | 22f54e753e00df17b956e67240fc94ee48b384f8 | |
| parent | 6ee48f12b3673f01fb2e6b8c3b09bfd9e1c81a47 (diff) | |
qcacld-2.0: Remove startup_task from SDIO solution
Currently, Host uses the separate startup_task for calling
hdd_wlan_startup and break insmod context. Essentially all
the operation performed in startup_task can be performed
in insmod context so this task is not necessary. Due to
having a separate task host have the following issue, assume
wlan driver probe get fail then startup_task becomes a zombie
thread which may lead to invalid access.
As a part of this fix, host call the hdd_wlan_startup in
insmod context and remove the startup_task.
Change-Id: I0ac8b4ef01f91539852935242176e6c1f0f3ba25
CRs-Fixed: 1027526
| -rw-r--r-- | CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 67 |
1 files changed, 18 insertions, 49 deletions
diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c index 218ce1cd7e44..07f5de1bf91e 100644 --- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c +++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c @@ -1504,39 +1504,6 @@ HIFSetMboxSleep(HIF_DEVICE *device, bool sleep, bool wait, bool cache) } #endif -/* handle HTC startup via thread*/ -static int startup_task(void *param) -{ - HIF_DEVICE *device; - - device = (HIF_DEVICE *)param; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call HTC from startup_task\n")); - /* start up inform DRV layer */ - if ((osdrvCallbacks.deviceInsertedHandler(osdrvCallbacks.context,device)) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device rejected\n")); - } - return 0; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) -static int enable_task(void *param) -{ - HIF_DEVICE *device; - device = (HIF_DEVICE *)param; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call from resume_task\n")); - - /* start up inform DRV layer */ - if (device && - device->claimedContext && - osdrvCallbacks.devicePowerChangeHandler && - osdrvCallbacks.devicePowerChangeHandler(device->claimedContext, HIF_DEVICE_POWER_UP) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device rejected\n")); - } - - return 0; -} -#endif static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id) { int i; @@ -1995,9 +1962,6 @@ static A_STATUS hifDisableFunc(HIF_DEVICE *device, struct sdio_func *func) static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func) { - struct task_struct* pTask; - const char *taskName = NULL; - int (*taskFunc)(void *) = NULL; int ret = A_OK; ENTER("sdio_func 0x%p", func); @@ -2117,23 +2081,28 @@ static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func) } if (!device->claimedContext) { - taskFunc = startup_task; - taskName = "AR6K startup"; - ret = A_OK; + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, + ("AR6k: call deviceInsertedHandler\n")); + ret = osdrvCallbacks.deviceInsertedHandler( + osdrvCallbacks.context,device); + /* start up inform DRV layer */ + if (ret != A_OK) + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, + ("AR6k: Device rejected error:%d \n", ret)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) } else { - taskFunc = enable_task; - taskName = "AR6K enable"; - ret = A_PENDING; + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, + ("AR6k: call devicePwrChangeApi\n")); + /* start up inform DRV layer */ + if (device && + device->claimedContext && + osdrvCallbacks.devicePowerChangeHandler && + ((ret = osdrvCallbacks.devicePowerChangeHandler( + device->claimedContext, HIF_DEVICE_POWER_UP)) != A_OK)) + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, + ("AR6k: Device rejected error:%d \n", ret)); #endif /* CONFIG_PM */ } - /* create resume thread */ - pTask = kthread_create(taskFunc, (void *)device, taskName); - if (IS_ERR(pTask)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), to create enabel task\n", __FUNCTION__)); - return A_ERROR; - } - wake_up_process(pTask); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifEnableFunc\n")); /* task will call the enable func, indicate pending */ |
