From 5e4000bde82eb43fbe9193600a414ab2338f663b Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Thu, 6 Feb 2020 17:03:49 +0530 Subject: [PATCH] qcacld-3.0: Remove validate_context check from wlan_resume Presently, there is a very narrow race condition that causes scheduler_thread to remain in a suspended state for undefined period of time. The race condition occuers between idle_psoc_timeout and wlan_hdd_cfg80211_resume_wlan. As a part of idle_psoc_timeout, the driver calls hdd_wlan_stop_modules that sets the flag "stop_module_in_progress" and checks if driver is in suspended state. If yes, it resets the flag and returns. But in the case of a race condition, before this reset and return is carried out, wlan_hdd_cfg80211_resume_wlan is invoked. The validate_context inside the resume function fails due to the above mentioned flag being set. As a result, resume fails and the driver stays in suspended state. This causes the driver to enter a infinite loop of stop_modules not being successful. To close this small window of contention, remove the validate_context check. hdd_ctx is always guranteed to be valid and also DSC takes care of synchronizing the operation, thus the check is redundant. Change-Id: I723f78e4c33bdc531776c46eff2428dbd869493f CRs-Fixed: 2616177 --- core/hdd/src/wlan_hdd_power.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index c8fa0fbcbf4e..2447c9437726 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1766,12 +1766,6 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) goto exit_with_code; } - exit_code = wlan_hdd_validate_context(hdd_ctx); - if (exit_code) { - hdd_err("Invalid HDD context"); - goto exit_with_code; - } - if (hdd_ctx->config->is_wow_disabled) { hdd_err("wow is disabled"); return -EINVAL;