diff options
| author | Rajeev Kumar <rajekuma@codeaurora.org> | 2017-03-31 20:25:23 -0700 |
|---|---|---|
| committer | Sandeep Puligilla <spuligil@codeaurora.org> | 2017-04-01 01:13:47 -0700 |
| commit | eea6b984aa9d7220f84d10c2130bb9bde3d6ba4b (patch) | |
| tree | b01515a8e0a3b24b2178b7b964eafd9a711d68c9 | |
| parent | bf0aa723d355f48dfdaa42cdbefa0ca10dd94e36 (diff) | |
qcacld-3.0: Handle module stop properly for FTM mode
In FTM mode con mode change handler does module stop
after holding SSR protect and module stop bails
out assuming its idle mode module stop. Make sure to
do module stop properly for FTM mode even if SSR
protect lock is taken by con mode change handler.
Change-Id: I5d2d7006bb9f4897a5dd22893cdf6a7a864de97b
CRs-Fixed: 2027020
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 16 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 4 |
3 files changed, 12 insertions, 10 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index ed4cf3c9c84a..3bcd3420d87a 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2224,7 +2224,7 @@ int hdd_start_ftm_adapter(hdd_adapter_t *adapter); int hdd_set_fw_params(hdd_adapter_t *adapter); int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, bool reinit); -int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx); +int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode); int hdd_start_adapter(hdd_adapter_t *adapter); /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8d28cbd38a8b..c4cf39d48980 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5170,7 +5170,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); } - hdd_wlan_stop_modules(hdd_ctx); + hdd_wlan_stop_modules(hdd_ctx, false); qdf_spinlock_destroy(&hdd_ctx->hdd_adapter_lock); qdf_spinlock_destroy(&hdd_ctx->sta_update_info_lock); @@ -8462,6 +8462,7 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) /** * hdd_wlan_stop_modules - Single driver state machine for stoping modules * @hdd_ctx: HDD context + * @ftm_mode: ftm mode * * This function maintains the driver state machine it will be invoked from * exit, shutdown and con_mode change handler. Depending on the driver state @@ -8469,7 +8470,7 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) * * Return: 0 for success; non-zero for failure */ -int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx) +int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode) { void *hif_ctx; qdf_device_t qdf_ctx; @@ -8499,10 +8500,11 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx) cds_print_external_threads(); - if (is_idle_stop) { + if (is_idle_stop && !ftm_mode) { mutex_unlock(&hdd_ctx->iface_change_lock); qdf_mc_timer_start(&hdd_ctx->iface_change_timer, - hdd_ctx->config->iface_change_wait_time); + hdd_ctx->config->iface_change_wait_time); + hdd_ctx->stop_modules_in_progress = false; return 0; } } @@ -8607,7 +8609,7 @@ static void hdd_iface_change_callback(void *priv) ENTER(); hdd_debug("Interface change timer expired close the modules!"); - ret = hdd_wlan_stop_modules(hdd_ctx); + ret = hdd_wlan_stop_modules(hdd_ctx, false); if (ret) hdd_err("Failed to stop modules"); EXIT(); @@ -8850,7 +8852,7 @@ err_wiphy_unregister: wiphy_unregister(hdd_ctx->wiphy); err_stop_modules: - hdd_wlan_stop_modules(hdd_ctx); + hdd_wlan_stop_modules(hdd_ctx, false); err_exit_nl_srv: if (DRIVER_MODULES_CLOSED == hdd_ctx->driver_status) { @@ -10527,7 +10529,7 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, /* Cleanup present mode before switching to new mode */ hdd_cleanup_present_mode(hdd_ctx, curr_mode); - ret = hdd_wlan_stop_modules(hdd_ctx); + ret = hdd_wlan_stop_modules(hdd_ctx, true); if (ret) { hdd_err("Stop wlan modules failed"); goto reset_flags; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index a325bf9cf5d5..477ce3ff2cde 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1539,7 +1539,7 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_bus_bandwidth_destroy(pHddCtx); - hdd_wlan_stop_modules(pHddCtx); + hdd_wlan_stop_modules(pHddCtx, false); hdd_lpass_notify_stop(pHddCtx); @@ -1659,7 +1659,7 @@ QDF_STATUS hdd_wlan_re_init(void) goto success; err_cds_disable: - hdd_wlan_stop_modules(pHddCtx); + hdd_wlan_stop_modules(pHddCtx, false); err_wiphy_unregister: if (bug_on_reinit_failure) |
