Kaynağa Gözat

qcacld-3.0: Prevent apps power collapse if negotiating DHCP

Currently, the apps processor can power collapse in the middle of
DHCP negatiation. A wake lock was added to prevent sleeping until
negotiation is complete.

Change-Id: I9f133667ddb8fe27f43e6d7491006b881ad56d44
CRs-Fixed: 1061879
Dustin Brown 8 yıl önce
ebeveyn
işleme
6a609d60e4

+ 3 - 0
core/hdd/src/wlan_hdd_power.c

@@ -2014,6 +2014,8 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 
 	if (!mode) {
 		hdd_err("DHCP start indicated through power save");
+		hdd_prevent_suspend_timeout(1000,
+					    WIFI_POWER_EVENT_WAKELOCK_DHCP);
 		sme_dhcp_start_ind(pHddCtx->hHal, pAdapter->device_mode,
 				   pAdapter->macAddressCurrent.bytes,
 				   pAdapter->sessionId);
@@ -2022,6 +2024,7 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 		sme_dhcp_stop_ind(pHddCtx->hHal, pAdapter->device_mode,
 				  pAdapter->macAddressCurrent.bytes,
 				  pAdapter->sessionId);
+		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DHCP);
 	}
 
 	EXIT();

+ 2 - 0
core/utils/host_diag_log/inc/host_diag_core_event.h

@@ -414,6 +414,7 @@ enum wifi_connectivity_events {
  * @WIFI_POWER_EVENT_WAKELOCK_DFS: DFS related wakelocks
  * @WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP: Firmware response
  * @WIFI_POWER_EVENT_WAKELOCK_MISC: Miscellaneous wakelocks
+ * @WIFI_POWER_EVENT_WAKELOCK_DHCP: DHCP negotiation under way
  *
  * Indicates the reason for which the wakelock was taken/released
  */
@@ -436,6 +437,7 @@ enum wake_lock_reason {
 	WIFI_POWER_EVENT_WAKELOCK_DFS,
 	WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP,
 	WIFI_POWER_EVENT_WAKELOCK_MISC,
+	WIFI_POWER_EVENT_WAKELOCK_DHCP,
 };
 
 #ifdef __cplusplus