qcacld-3.0: Fix ACS delayed worker running after adapter stopped

While ACS delayed worker scheduled and is running the function
wlan_hdd_cfg80211_start_acs(), ACS_PENDING has already been cleared by
wlan_hdd_cfg80211_start_pending_acs() before it, so the later coming
stop sap event can't cancel the running delayed worker and free the
sap context which need access by delayed worker.

Fix by clear ACS_PENDING after wlan_hdd_cfg80211_start_acs(), and move
cancel ACS delayed worker before cancel any scan, it can cancel ACS
scan invoke by delayed worker and avoid race condition.

CRs-Fixed: 2289364
Change-Id: Ibd771fc199a0778ac1d8f1f04ba22b49014437de
This commit is contained in:
Will Huang 2018-08-13 17:25:02 +08:00 committed by nshrivas
parent 57b264e259
commit 7049baea18
2 changed files with 5 additions and 8 deletions

View File

@ -2856,8 +2856,8 @@ static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work)
struct hdd_adapter *adapter = container_of(work, struct hdd_adapter,
acs_pending_work.work);
clear_bit(ACS_PENDING, &adapter->event_flags);
wlan_hdd_cfg80211_start_acs(adapter);
clear_bit(ACS_PENDING, &adapter->event_flags);
}
/**

View File

@ -5247,6 +5247,10 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
break;
case QDF_SAP_MODE:
if (test_bit(ACS_PENDING, &adapter->event_flags)) {
cds_flush_delayed_work(&adapter->acs_pending_work);
clear_bit(ACS_PENDING, &adapter->event_flags);
}
wlan_hdd_scan_abort(adapter);
/* Flush IPA exception path packets */
sap_config = &adapter->session.ap.sap_config;
@ -5259,13 +5263,6 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
/* fallthrough */
case QDF_P2P_GO_MODE:
if (QDF_SAP_MODE == adapter->device_mode) {
if (test_bit(ACS_PENDING, &adapter->event_flags)) {
cds_flush_delayed_work(
&adapter->acs_pending_work);
clear_bit(ACS_PENDING, &adapter->event_flags);
}
}
cds_flush_work(&adapter->sap_stop_bss_work);
/* Any softap specific cleanup here... */