From cbffd583069b901553385f400a5c674c9ff0568c Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Sat, 16 Nov 2019 11:44:20 +0530 Subject: [PATCH] qcacld-3.0: Initialize the acs pending work in do acs Scenario:- Two ACS request come in parallel, for two SAP startup The driver started with one ACS, and scheduled the other after the first one is complete,driver sets a bit in flag of adapter that is test_bit(ACS_PENDING, &adapter->event_flags) and then schedule work when the ACS channel is selected in the API wlan_hdd_cfg80211_acs_ch_select_evt. After this driver got delete interface for the second interface and as part of it in hdd stop adapter driver checks that if the flag of pending ACS is set, flush the pending ACS work, and reset the flag. But the work is yet to be initialized, which would be done as part of wlan_hdd_cfg80211_acs_ch_select_evt and it is not yet completed as the first ACS is busy with the ACS scan, and the scan callback and channel selection logic is still yet to be done. Fix is to initialize the work when the driver detects that first ACS is in progress, and it needs to wait for the first one to complete. Change-Id: If706528f1afd6075144bff40611e82742df76368 CRs-Fixed: 2559703 --- core/hdd/src/wlan_hdd_cfg80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 0b6e81bc29a4..bc3a61c3c900 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3140,6 +3140,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, * Since this CFG80211 call lock rtnl mutex, we cannot hold on * for this long. So we split up the scanning part. */ + INIT_DELAYED_WORK(&adapter->acs_pending_work, + wlan_hdd_cfg80211_start_pending_acs); set_bit(ACS_PENDING, &adapter->event_flags); hdd_debug("ACS Pending for %s", adapter->dev->name); ret = 0; @@ -3472,8 +3474,6 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter) con_sap_adapter = hdd_get_con_sap_adapter(adapter, false); if (con_sap_adapter && test_bit(ACS_PENDING, &con_sap_adapter->event_flags)) { - INIT_DELAYED_WORK(&con_sap_adapter->acs_pending_work, - wlan_hdd_cfg80211_start_pending_acs); /* Lets give 1500ms for OBSS + START_BSS to complete */ schedule_delayed_work(&con_sap_adapter->acs_pending_work, msecs_to_jiffies(1500));