Parcourir la source

qcacld-3.0: Move HIF RTPM put before validate context check in cfg80211 resume

If FW asserts before cfg80211 resume, cfg80211 resume will skip calling RTPM
put, which finally results a usage count mismatch. To fix it move RTPM put call
at the beginning of cfg80211 resume to make sure its always called and RTPM usage
count is in sync.

Change-Id: If0c9fbe094de16d103cd58ed4db3b08b76adb3cf
CRs-Fixed: 2728742
Rajeev Kumar il y a 4 ans
Parent
commit
a3e85cc8b2
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      core/hdd/src/wlan_hdd_power.c

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

@@ -1896,6 +1896,10 @@ static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
 	int errno;
 
+	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	if (hif_ctx)
+		hif_pm_runtime_put(hif_ctx, RTPM_ID_SUSPEND_RESUME);
+
 	if (!hdd_ctx) {
 		hdd_err_rl("hdd context is null");
 		return -ENODEV;
@@ -1911,12 +1915,8 @@ static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
 	if (errno)
 		return errno;
 
-	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx)
-		return -EINVAL;
 
 	errno = __wlan_hdd_cfg80211_resume_wlan(wiphy);
-	hif_pm_runtime_put(hif_ctx, RTPM_ID_SUSPEND_RESUME);
 
 	return errno;
 }