Bläddra i källkod

qcacld-3.0: fix wlan suspend fail after switch to non-dfs channel

qcacld-2.0 to qcacld-3.0 propagation

In SAP DFS test, DUT can't goto suspend if SAP started
on DFS channel and later switched to non-dfs channel due to
Radar detected.
During SAP Starting, driver will acquire the wake lock
for dfs channel by hdd_hostapd_channel_prevent_suspend
in the eSAP_CHANNEL_CHANGE_EVENT event handler. But the SAP
is still in STOPPED state. We acquire the wake lock again
after SAP started in eSAP_START_BSS_EVENT event handler.
This causes driver to acquire wake lock twice for the
same dfs channel. And finally causes the device can't
suspend normally.
This change add check in eSAP_CHANNEL_CHANGE_EVENT
handler to only call hdd_hostapd_channel_prevent_suspend
when SAP is in started state to avoid lock/unlock mismatch.

Change-Id: Ief90697b7b6f19f6fcf0ab94f973a37e74ca3366
CRs-Fixed: 972657
Liangwei Dong 8 år sedan
förälder
incheckning
5047d513ab
1 ändrade filer med 8 tillägg och 6 borttagningar
  1. 8 6
      core/hdd/src/wlan_hdd_hostapd.c

+ 8 - 6
core/hdd/src/wlan_hdd_hostapd.c

@@ -1810,12 +1810,14 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 
 	case eSAP_CHANNEL_CHANGE_EVENT:
 		hdd_notice("Received eSAP_CHANNEL_CHANGE_EVENT event");
-		/* Prevent suspend for new channel */
-		hdd_hostapd_channel_prevent_suspend(pHostapdAdapter,
-					pSapEvent->sapevt.sap_ch_selected.pri_ch);
-		/* Allow suspend for old channel */
-		hdd_hostapd_channel_allow_suspend(pHostapdAdapter,
-					pHddApCtx->operatingChannel);
+		if (pHostapdState->bssState != BSS_STOP) {
+			/* Prevent suspend for new channel */
+			hdd_hostapd_channel_prevent_suspend(pHostapdAdapter,
+				pSapEvent->sapevt.sap_ch_selected.pri_ch);
+			/* Allow suspend for old channel */
+			hdd_hostapd_channel_allow_suspend(pHostapdAdapter,
+				pHddApCtx->operatingChannel);
+		}
 		/* SME/PE is already updated for new operation channel. So update
 		* HDD layer also here. This resolves issue in AP-AP mode where
 		* AP1 channel is changed due to RADAR then CAC is going on and