Browse Source

qcacld-3.0: Fix stop_bss_event timeout issue

Sometimes 'qdf_event_set(&hostapd_state->qdf_stop_bss_event)'
is invoked from 'wlansap_stop_bss' in other thread before
invoking 'qdf_event_reset(&hostapd_state->qdf_stop_bss_event)'.
Then 'stop_bss_event' timeout happens even if 'qdf_stop_bss_event'
has been set.

To fix this issue, make sure 'qdf_event_reset(&hostapd_state->
qdf_stop_bss_event)' happens before 'wlansap_stop_bss'.

Change-Id: I2e591290453e0a6463f04680fd8c476738ae8a65
CRs-Fixed: 3060404
Rongjing Liao 3 years ago
parent
commit
d0be368b20
1 changed files with 4 additions and 4 deletions
  1. 4 4
      core/hdd/src/wlan_hdd_main.c

+ 4 - 4
core/hdd/src/wlan_hdd_main.c

@@ -7775,14 +7775,14 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 
 		mutex_lock(&hdd_ctx->sap_lock);
 		if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
+			struct hdd_hostapd_state *hostapd_state =
+				WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
+
+			qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
 			status = wlansap_stop_bss(
 					WLAN_HDD_GET_SAP_CTX_PTR(adapter));
 
 			if (QDF_IS_STATUS_SUCCESS(status)) {
-				struct hdd_hostapd_state *hostapd_state =
-					WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
-				qdf_event_reset(&hostapd_state->
-						qdf_stop_bss_event);
 				status = qdf_wait_single_event(
 					&hostapd_state->qdf_stop_bss_event,
 					SME_CMD_STOP_BSS_TIMEOUT);