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
This commit is contained in:
Rajeev Kumar 2020-09-08 12:55:41 -07:00 • committed by snandini
commit a3e85cc8b2

View file

@ -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;
}