summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashanth Bhatta <bhattap@qca.qualcomm.com>2015-08-11 17:45:26 -0700
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-08-14 15:50:14 +0530
commite4e3f3fa2f5aa8d519624c2efea4d9372099951a (patch)
treec7ef336f9a7d19d1ddbaa8f89aa3e96ff29deb2c
parentf174617a3adf478a17a9515d33968e5c5becd903 (diff)
qcacld: wma: Fix issue with WoW during resume
In disconnected case, during suspend, no Wow patterns are configured but during resume WoW patterns are deleted which never was configured during the suspend. This should be fine if system resume is called before cfg80211 resume but in some case like the change added in kernel 7cd0602d7836c0056fe9bdab014d5ac5ec5cb291, system suspend would not be called to optimize the system suspend time and during resume, while handling cfg80211 resume tries to delete WoW pattern which it shouldn't and leading to bus error and crash the system. Fix the issue by checking if the WoW patterns are configured and if they are not then don't try to delete them as well. Also along with this change, improving the suspend/resume logs to indicate if the suspend/resume is for runtime or system. Change-Id: I5eae66e09d5fac4f913c0eaaf90ff600d8c7d626 CRs-fixed: 889466
-rw-r--r--CORE/SERVICES/HIF/PCIe/if_pci.c19
-rw-r--r--CORE/SERVICES/WMA/wma.c30
2 files changed, 37 insertions, 12 deletions
diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c
index 5448a0268cc7..f6f3b701164d 100644
--- a/CORE/SERVICES/HIF/PCIe/if_pci.c
+++ b/CORE/SERVICES/HIF/PCIe/if_pci.c
@@ -2189,11 +2189,13 @@ __hif_pci_suspend(struct pci_dev *pdev, pm_message_t state, bool runtime_pm)
}
if (wma_check_scan_in_progress(temp_module)) {
- printk("%s: Scan in progress. Aborting suspend\n", __func__);
+ printk("%s: Scan in progress. Aborting suspend%s\n", __func__,
+ runtime_pm ? " for runtime PM" : "");
goto out;
}
- printk("%s: wow mode %d event %d\n", __func__,
+ printk("%s: %swow mode %d event %d\n", __func__,
+ runtime_pm ? "for runtime pm " : "",
wma_is_wow_mode_selected(temp_module), state.event);
if (wma_is_wow_mode_selected(temp_module)) {
@@ -2284,7 +2286,8 @@ __hif_pci_suspend(struct pci_dev *pdev, pm_message_t state, bool runtime_pm)
pci_write_config_dword(pdev, OL_ATH_PCI_PM_CONTROL, (val & 0xffffff00) | 0x03);
}
- printk("%s: Suspend completes\n", __func__);
+ printk("%s: Suspend completes%s\n", __func__,
+ runtime_pm ? " for runtime pm" : "");
ret = 0;
out:
@@ -2364,7 +2367,7 @@ __hif_pci_resume(struct pci_dev *pdev, bool runtime_pm)
/* Set bus master bit in PCI_COMMAND to enable DMA */
pci_set_master(pdev);
- printk("\n%s: Rome PS: %d", __func__, val);
+ printk("%s: Rome PS: %d\n", __func__, val);
#ifdef CONFIG_CNSS
/* Keep PCIe bus driver's shadow memory intact */
@@ -2389,8 +2392,9 @@ __hif_pci_resume(struct pci_dev *pdev, bool runtime_pm)
goto out;
}
- printk("%s: wow mode %d val %d\n", __func__,
- wma_is_wow_mode_selected(temp_module), val);
+ printk("%s: %swow mode %d val %d\n", __func__,
+ runtime_pm ? "for runtime pm " : "",
+ wma_is_wow_mode_selected(temp_module), val);
adf_os_atomic_set(&sc->wow_done, 0);
@@ -2411,7 +2415,8 @@ __hif_pci_resume(struct pci_dev *pdev, bool runtime_pm)
#endif
out:
- printk("%s: Resume completes %d\n", __func__, err);
+ printk("%s: Resume completes%s %d\n", __func__,
+ runtime_pm ? " for runtime pm" : "", err);
if (err)
return (-1);
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index a481377bad32..73a4ab1642bf 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -19741,7 +19741,22 @@ static VOS_STATUS wma_resume_req(tp_wma_handle wma, bool runtime_pm)
wma->no_of_resume_ind = 0;
skip_vdev_suspend:
- WMA_LOGD("Clearing already configured wow patterns in fw");
+ WMA_LOGD("Clearing already configured wow patterns in fw%s,"
+ " wow_enable: %d, wow_enable_cmd_sent: %d",
+ runtime_pm ? " for runtime PM" : "",
+ wma->wow.wow_enable, wma->wow.wow_enable_cmd_sent);
+
+ if (!wma->wow.wow_enable) {
+ WMA_LOGD("WoW pattern not configured in FW during suspend,"
+ " skip delete!");
+ goto end;
+ }
+
+ if (wma->wow.wow_enable_cmd_sent) {
+ WMA_LOGD("Firmware is still in WoW mode, don't delete WoW"
+ " patterns");
+ goto end;
+ }
/* Clear existing wow patterns in FW. */
for (ptrn_id = 0; ptrn_id < wma->wlan_resource_config.num_wow_filters;
@@ -19751,6 +19766,7 @@ skip_vdev_suspend:
goto end;
}
+ wma->wow.wow_enable = FALSE;
end:
/* Reset the DTIM Parameters */
wma_set_resume_dtim(wma);
@@ -19780,6 +19796,12 @@ static VOS_STATUS wma_feed_wow_config_to_fw(tp_wma_handle wma,
#endif
bool wps_enable = false;
+ if (wma->wow.wow_enable) {
+ WMA_LOGD("WoW config%s already fed to FW! skip it",
+ runtime_pm ? " for runtime suspend" : " ");
+ return ret;
+ }
+
/* Gather list of free ptrn id. This is needed while configuring
* default wow patterns.
*/
@@ -20303,7 +20325,7 @@ suspend_all_iface:
}
enable_wow:
- WMA_LOGD("WOW Suspend");
+ WMA_LOGD("%sWOW Suspend", info ? "" : "Runtime PM ");
/*
* At this point, suspend indication is received on
@@ -20484,7 +20506,6 @@ VOS_STATUS wma_disable_d0wow_in_fw(tp_wma_handle wma)
VOS_BUG(0);
}
- wma->wow.wow_enable = FALSE;
wma->wow.wow_enable_cmd_sent = FALSE;
wmi_set_d0wow_flag(wma->wmi_handle, FALSE);
WMA_LOGD("D0-WOW is disabled successfully in FW.");
@@ -20502,7 +20523,7 @@ int wma_disable_wow_in_fw(WMA_HANDLE handle, int runtime_pm)
tp_wma_handle wma = handle;
VOS_STATUS ret;
- if(!wma->wow.wow_enable || !wma->wow.wow_enable_cmd_sent) {
+ if (!wma->wow.wow_enable_cmd_sent) {
return VOS_STATUS_SUCCESS;
}
@@ -20521,7 +20542,6 @@ int wma_disable_wow_in_fw(WMA_HANDLE handle, int runtime_pm)
if (ret != VOS_STATUS_SUCCESS)
return ret;
- wma->wow.wow_enable = FALSE;
wma->wow.wow_enable_cmd_sent = FALSE;
/* To allow the tx pause/unpause events */