diff options
| author | Jianmin Zhu <jianminz@codeaurora.org> | 2018-08-07 17:23:42 +0800 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-08-10 12:45:50 -0700 |
| commit | 319064b4c185ddaec0752011ffb2717eaaec7f95 (patch) | |
| tree | ed55f3e9119b0c9929b7f30d7e5e9adfc33a5b76 | |
| parent | 6b6557aba8d557ef05890e98a2a32c095afbd068 (diff) | |
qcacld-3.0: Reject host suspend in driver open state
After insmod wlan.ko, don't ifconfig wlan0 up, driver will be in
DRIVER_MODULES_OPENED instead of DRIVER_MODULES_ENABLED state.
If host suspend at this time, PCIE will suspend too, when resume,
PCIE bus driver may reset ROME soc during link reconnection, copy
engine is reset too.
When host send wmi cmd to F/W, copy engine will access 0 address,
SMMU fault will happen.
There is logic inside ROME hardware&firmware, if PDEV_SUSPEND or
WOW_ENABLE WMI command is sent to firmware, firmware will decuple
the reset path between ROME pcie interface and ROME soc,
then ROME soc will not be reset if pcie bus driver toggle the
PERST pin to ENDP, only pcie interface part is reset.
Change-Id: I3b6344f69ea70248953af155efd00adf7914e98b
CRs-Fixed: 2243667
| -rw-r--r-- | core/hdd/src/wlan_hdd_driver_ops.c | 10 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 507ae0145a38..c6824643b1d3 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -770,6 +770,11 @@ static int __wlan_hdd_bus_suspend_noirq(void) return err; } + if (hdd_ctx->driver_status == DRIVER_MODULES_OPENED) { + hdd_err("Driver open state, can't suspend"); + return -EAGAIN; + } + if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) { hdd_debug("Driver Module closed return success"); return 0; @@ -851,6 +856,11 @@ static int __wlan_hdd_bus_resume(void) return status; } + if (hdd_ctx->driver_status == DRIVER_MODULES_OPENED) { + hdd_err("Driver open state, can't suspend"); + return -EAGAIN; + } + if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) { hdd_debug("Driver Module closed; return success"); return 0; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 2bd96b39c0cc..0e9f022b4921 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1990,6 +1990,13 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, return rc; mutex_lock(&pHddCtx->iface_change_lock); + + if (pHddCtx->driver_status == DRIVER_MODULES_OPENED) { + mutex_unlock(&pHddCtx->iface_change_lock); + hdd_err("Driver open state, can't suspend"); + return -EAGAIN; + } + if (pHddCtx->driver_status != DRIVER_MODULES_ENABLED) { mutex_unlock(&pHddCtx->iface_change_lock); hdd_debug("Driver Modules not Enabled "); |
