Bladeren bron

qcacld-3.0: Sync runtime pm resume when system suspend occurs

Some system suspend commands are getting sent to firmware while
runtime resume is in progress. Sync runtime pm resume when system
suspend occurs to avoid this.

Change-Id: I6e652104e984b81e29a5f328fcf3937502a8f47f
CRs-Fixed: 2509910
Alan Chen 5 jaren geleden
bovenliggende
commit
6ccc4fa788
1 gewijzigde bestanden met toevoegingen van 32 en 2 verwijderingen
  1. 32 2
      core/hdd/src/wlan_hdd_power.c

+ 32 - 2
core/hdd/src/wlan_hdd_power.c

@@ -1671,6 +1671,17 @@ exit_with_code:
 	return exit_code;
 }
 
+static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
+{
+	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	int errno;
+
+	errno = __wlan_hdd_cfg80211_resume_wlan(wiphy);
+	hif_pm_runtime_put(hif_ctx);
+
+	return errno;
+}
+
 int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
 {
 	struct osif_psoc_sync *psoc_sync;
@@ -1680,7 +1691,7 @@ int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
 	if (errno)
 		return errno;
 
-	errno = __wlan_hdd_cfg80211_resume_wlan(wiphy);
+	errno = _wlan_hdd_cfg80211_resume_wlan(wiphy);
 
 	osif_psoc_sync_op_stop(psoc_sync);
 
@@ -1870,6 +1881,25 @@ resume_tx:
 
 }
 
+static int _wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
+					   struct cfg80211_wowlan *wow)
+{
+	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	int errno;
+
+	errno = hif_pm_runtime_get_sync(hif_ctx);
+	if (errno)
+		return errno;
+
+	errno = __wlan_hdd_cfg80211_suspend_wlan(wiphy, wow);
+	if (errno) {
+		hif_pm_runtime_put(hif_ctx);
+		return errno;
+	}
+
+	return errno;
+}
+
 int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 				   struct cfg80211_wowlan *wow)
 {
@@ -1880,7 +1910,7 @@ int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 	if (errno)
 		return errno;
 
-	errno = __wlan_hdd_cfg80211_suspend_wlan(wiphy, wow);
+	errno = _wlan_hdd_cfg80211_suspend_wlan(wiphy, wow);
 
 	osif_psoc_sync_op_stop(psoc_sync);