summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Huang <wilhuang@codeaurora.org>2018-04-13 11:48:51 +0800
committernshrivas <nshrivas@codeaurora.org>2018-10-09 01:59:26 -0700
commit8343c5fe516da02da9ccd4d267694b5bb7bb3671 (patch)
treea091759d1b5c7cafec4a2e3080f58461711df6b1
parent1b1ab87aa3c429e50f22f9d6a1e97921a75e5de5 (diff)
qcacld-3.0: Move qdf_cancel_delayed_work to __hdd_module_exit
If hdd_wlan_stop_modules is called by hdd_iface_change_callback which is invoke by a delayed worker, and a race condition happen that rmmod call in during hdd_wlan_stop_modules, although cnss driver will serialize wlan remove with the wlan shutdown invoked by delayed worker, CNSS_DRIVER_UNLOADING still got set and wlan shutdown will invoke remove wlan, which will try to sync cancel delayed worker and wait for each other to deadlock. If move qdf_cancel_delayed_work() from hdd_wlan_exit() to __hdd_module_exit(), it will flush/wait in a different context of cnss driver worker, so avoid deadlock hit. Change-Id: I6bc58e8ae70291d5490560310e90abc52421b59f CRs-Fixed: 2222381
-rw-r--r--core/hdd/src/wlan_hdd_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index bd1d50deaca2..e78516c0f6f2 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -6685,8 +6685,6 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx)
ENTER();
- qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work);
-
hdd_unregister_notifiers(hdd_ctx);
if (QDF_TIMER_STATE_RUNNING ==
@@ -12544,12 +12542,17 @@ err_hdd_init:
*/
static void __hdd_module_exit(void)
{
+ hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+
pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME,
QWLAN_VERSIONSTR);
if (!hdd_wait_for_recovery_completion())
return;
+ if (hdd_ctx)
+ qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work);
+
wlan_hdd_unregister_driver();
qdf_wake_lock_destroy(&wlan_wake_lock);