qcacld-3.0: Prevent race between suspend and idle shutdown

Idle shutdown is running in Thread 1 and in parallel suspend
request comes which is getting executed in thread 2. As a part
of idle shutdown the CE buffers are freed.As a result of this
WoW Ack is not reaped which leads to panic.

To avoid this issue, flush the idle shutdown delayed work before
proceeding for suspend.

CRs-Fixed: 2839296
Change-Id: I449bb1960776bf3d60e329a189b7bad998929240
This commit is contained in:
Sachin Ahuja 2020-12-16 17:29:06 +05:30
commit 9d7aa9bb8c
2 changed files with 10 additions and 7 deletions

View file

@ -1128,10 +1128,13 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
hdd_info("starting bus suspend");
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err_rl("hdd context is NULL");
return -ENODEV;
}
err = wlan_hdd_validate_context(hdd_ctx);
if (err)
return err;
/* Wait for the stop module if already in progress */
hdd_psoc_idle_timer_stop(hdd_ctx);
/* If Wifi is off, return success for system suspend */
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@ -1139,9 +1142,6 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
return 0;
}
err = wlan_hdd_validate_context(hdd_ctx);
if (err)
return err;
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (!hif_ctx) {

View file

@ -2023,6 +2023,9 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
if (0 != rc)
return rc;
/* Wait for the stop module if already in progress */
hdd_psoc_idle_timer_stop(hdd_ctx);
if (hdd_ctx->config->is_wow_disabled) {
hdd_info_rl("wow is disabled");
return -EINVAL;