From 4a40f3bd18f4e097a07824114da23549992a1707 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Mon, 28 Dec 2020 02:16:12 +0530 Subject: [PATCH] qcacld-3.0: add sync between suspend and wow resume in runtime pm In moselle, once wow enabled there is a possibility that wow wake interrupt can be fired from FW during runtime suspend in progress in host, this will introduce a race between runtime suspend and resume, so adding a synchronization between runtime suspend and wow triggered runtime resume. Change-Id: I19a4d70f47d5c202d0ba291c3edc8a260690f434 CRs-Fixed: 2845670 --- components/pmo/core/src/wlan_pmo_suspend_resume.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index 3a27602d3f25..b3b880133f50 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -970,6 +970,7 @@ QDF_STATUS pmo_core_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc *psoc, QDF_STATUS status; int ret; struct pmo_wow_enable_params wow_params = {0}; + struct pmo_psoc_priv_obj *psoc_ctx; qdf_time_t begin, end; int pending; @@ -1057,7 +1058,16 @@ QDF_STATUS pmo_core_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc *psoc, } } + hif_pm_runtime_suspend_lock(hif_ctx); + psoc_ctx = pmo_psoc_get_priv(psoc); + if (pmo_core_get_wow_initial_wake_up(psoc_ctx)) { + hif_pm_runtime_suspend_unlock(hif_ctx); + pmo_err("Target wake up received before suspend completion"); + status = QDF_STATUS_E_BUSY; + goto resume_hif; + } hif_process_runtime_suspend_success(hif_ctx); + hif_pm_runtime_suspend_unlock(hif_ctx); goto dec_psoc_ref;