From 3e966cc868948da1fb291d1946a6ceb6cc630e31 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Sat, 8 Aug 2020 20:34:24 +0530 Subject: [PATCH] qcacld-3.0: Disable the scheduler thread in the init error path During the module initialization the scheduler thread and the init thread run in parallel if there is a failure in the error path, the scheduler thread is not aware and still sending the messages to firmware resulting in system instability. Disable the scheduler as soon as there is an error in the init path. Change-Id: I50546a84cbfed86a0bdd6e4e38ede411f4e924d2 CRs-Fixed: 2742025 --- core/hdd/src/wlan_hdd_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 65f2d2302026c..3ed98870a2093 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3929,7 +3929,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) ret = hdd_configure_cds(hdd_ctx); if (ret) { hdd_err("Failed to Enable cds modules; errno: %d", ret); - goto destroy_driver_sysfs; + goto sched_disable; } hdd_enable_power_management(hdd_ctx); @@ -3955,11 +3955,14 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) hdd_exit(); return 0; - -destroy_driver_sysfs: +/* + * Disable scheduler 1st so that scheduler thread dosent send messages to fw + * in parallel to the cleanup + */ +sched_disable: + dispatcher_disable(); hdd_destroy_sysfs_files(); cds_post_disable(); - unregister_notifiers: hdd_unregister_notifiers(hdd_ctx);