diff options
| author | Hanumanth Reddy Pothula <c_hpothu@codeaurora.org> | 2016-11-21 19:06:38 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-11-29 23:11:49 -0800 |
| commit | 9a575be6de2c73b322cafa1a27c22d9c38e41fbf (patch) | |
| tree | 4b57a21fe78183eb309b38e3a99787aa91eb9005 | |
| parent | 72f1384f5ca452b2ab06ace2508aaffc569dd408 (diff) | |
qcacld-2.0: Initialize thread stuck timer after driver loading is done
prima to qcacld-2.0 propagation.
Presently, thread stuck timer starts before initializing timer
work queue(along with work queue spinlock and linked-list are
initialized), which is scheduled on timer expire, leading to
crash if timer expires before work queue is initialized.
Also, as thread stuck timer callback won't be processed during
driver loading, initializing thread stuck timer once done with
driver loading.
Change-Id: Ibb289f93481ae39585a6c2c56e8eefca267d6330
CRs-Fixed: 1086969
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 7 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 2 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_sched.c | 40 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_sched.h | 1 |
4 files changed, 32 insertions, 18 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index f337788285f4..68142b1cb1ad 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -15850,6 +15850,13 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); vos_set_load_in_progress(VOS_MODULE_ID_VOSS, FALSE); + if (pHddCtx->cfg_ini->fIsLogpEnabled) { + vos_wdthread_init_timer_work(vos_process_wd_timer); + /* Initialize the timer to detect thread stuck issues */ + vos_thread_stuck_timer_init( + &((VosContextType*)pVosContext)->vosWatchdog); + } + if (pHddCtx->cfg_ini->enable_dynamic_sta_chainmask) hdd_decide_dynamic_chain_mask(pHddCtx, HDD_ANTENNA_MODE_1X1); diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index fd9011072dc5..7bad9fc1cdf2 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -423,8 +423,6 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, v_SIZE_t hddContextSize ) /* Initialize the timer module */ vos_timer_module_init(); - vos_wdthread_init_timer_work(vos_process_wd_timer); - /* Initialize bug reporting structure */ vos_init_log_completion(); diff --git a/CORE/VOSS/src/vos_sched.c b/CORE/VOSS/src/vos_sched.c index 9db28ed0fca7..c79a9c5bed1c 100644 --- a/CORE/VOSS/src/vos_sched.c +++ b/CORE/VOSS/src/vos_sched.c @@ -1045,6 +1045,30 @@ static void vos_wd_detect_thread_stuck_cb(void *priv) } } + /** + * vos_thread_stuck_timer_init - Initialize thread stuck timer + * + * @wd_ctx: watchdog context. + * + * Return: void + */ +void vos_thread_stuck_timer_init(pVosWatchdogContext wd_ctx) +{ + if (vos_timer_init(&wd_ctx->thread_stuck_timer, + VOS_TIMER_TYPE_SW, + vos_wd_detect_thread_stuck_cb, NULL)) + hddLog(LOGE, FL("Unable to initialize thread stuck timer")); + else + { + if (VOS_STATUS_SUCCESS != + vos_timer_start(&wd_ctx->thread_stuck_timer, + THREAD_STUCK_TIMER_VAL)) + hddLog(LOGE, FL("Unable to start thread stuck timer")); + else + hddLog(LOG1, FL("Successfully started thread stuck timer")); + } +} + /** * vos_wd_reset_thread_stuck_count()- Callback to * probe msg sent to Threads. @@ -1097,22 +1121,6 @@ VosWDThread #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) daemonize("WD_Thread"); #endif - /* Initialize the timer to detect thread stuck issues */ - if (vos_timer_init(&gpVosWatchdogContext->thread_stuck_timer, - VOS_TIMER_TYPE_SW, vos_wd_detect_thread_stuck_cb, NULL)) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "Unable to initialize thread stuck timer"); - } else { - if (VOS_STATUS_SUCCESS != - vos_timer_start(&gpVosWatchdogContext->thread_stuck_timer, - THREAD_STUCK_TIMER_VAL)) - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "Unable to start thread stuck timer"); - else - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "Successfully started thread stuck timer"); - } - /* ** Ack back to the context from which the Watchdog thread has been ** created. diff --git a/CORE/VOSS/src/vos_sched.h b/CORE/VOSS/src/vos_sched.h index e1036f399914..a04573f89e9a 100644 --- a/CORE/VOSS/src/vos_sched.h +++ b/CORE/VOSS/src/vos_sched.h @@ -658,6 +658,7 @@ int vos_get_gfp_flags(void); void vos_wd_reset_thread_stuck_count(int thread_id); bool vos_is_wd_thread(int thread_id); int vos_sched_is_mc_thread(int thread_id); +void vos_thread_stuck_timer_init(pVosWatchdogContext wd_ctx); #define vos_wait_for_work_thread_completion(func) vos_is_ssr_ready(func) |
