From a78cc1d70b0cccb756bf8f0a92afc4ba3e7ad3e7 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Thu, 1 Feb 2018 02:19:30 -0500 Subject: [PATCH] qcacld-3.0: Fix deadlock in driver probe failure Wlan driver probe callback is called in CNSS work thread(cnss_driver_event_work in cnss_powerup). In case the hdd_wlan_startup failed, and doing cleanup in hdd_wlan_stop_modules, the later will call and pending on pld_power_off to wait for cnss completion. So, deadlock happended. Don't need to call power_down because we are in (driver loading). Fix by check driver loading state to skip power_down. Change-Id: Ib8605d91e01277ccdf4a67e09723c3ee34ceec0d CRs-Fixed: 2183039 --- core/hdd/src/wlan_hdd_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1f79725893dc..42c439f90507 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10065,7 +10065,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_STATUS qdf_status; int ret = 0; bool is_recovery_stop = cds_is_driver_recovering(); - bool is_idle_stop = !cds_is_driver_unloading() && !is_recovery_stop; + bool is_idle_stop = !cds_is_driver_unloading() && !is_recovery_stop && + !cds_is_driver_loading(); int active_threads; struct target_psoc_info *tgt_hdl;