From 13833d2d6e31cec1923db247c8a526d846d38f5d Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Fri, 30 Apr 2021 14:45:38 +0530 Subject: [PATCH] qcacld-3.0: Set ep vote access states during suspend and resume Set ep vote states during wlan suspend and resume opeartions Change-Id: I5da5fb69ca99ac1d9ecd82cc61cc106eeba8eb47 CRs-Fixed: 2939902 --- .../pmo/core/src/wlan_pmo_suspend_resume.c | 19 +++++++++++++++++++ core/hdd/src/wlan_hdd_driver_ops.c | 6 ++++++ 2 files changed, 25 insertions(+) diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index 26af1621d3df..e2e02f48154c 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -1171,6 +1171,12 @@ QDF_STATUS pmo_core_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc *psoc, hif_process_runtime_suspend_success(hif_ctx); } + if (hif_try_prevent_ep_vote_access(hif_ctx)) { + pmo_debug("Prevent suspend, ep work pending"); + status = QDF_STATUS_E_BUSY; + goto resume_txrx; + } + goto dec_psoc_ref; resume_txrx: @@ -1330,12 +1336,22 @@ QDF_STATUS pmo_core_psoc_send_host_wakeup_ind_to_fw( struct pmo_psoc_priv_obj *psoc_ctx) { QDF_STATUS status = QDF_STATUS_SUCCESS; + void *hif_ctx; pmo_enter(); + + hif_ctx = pmo_core_psoc_get_hif_handle(psoc); + hif_set_ep_vote_access(hif_ctx, + HIF_EP_VOTE_NONDP_ACCESS, + HIF_EP_VOTE_ACCESS_ENABLE); + qdf_event_reset(&psoc_ctx->wow.target_resume); status = pmo_tgt_psoc_send_host_wakeup_ind(psoc); if (status) { + hif_set_ep_vote_access(hif_ctx, + HIF_EP_VOTE_NONDP_ACCESS, + HIF_EP_VOTE_ACCESS_DISABLE); status = QDF_STATUS_E_FAILURE; goto out; } @@ -1355,6 +1371,9 @@ QDF_STATUS pmo_core_psoc_send_host_wakeup_ind_to_fw( pmo_debug("Host wakeup received"); pmo_tgt_update_target_suspend_flag(psoc, false); pmo_tgt_update_target_suspend_acked_flag(psoc, false); + hif_set_ep_vote_access(hif_ctx, + HIF_EP_VOTE_DP_ACCESS, + HIF_EP_VOTE_ACCESS_ENABLE); } out: pmo_exit(); diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index f6f7d24479e9..0ab0108eb8e8 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1237,6 +1237,12 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params) goto resume_txrx; } + if (hif_try_prevent_ep_vote_access(hif_ctx)) { + hdd_debug("Prevent suspend, ep work pending"); + err = QDF_STATUS_E_BUSY; + goto resume_txrx; + } + /* * Remove bus votes at the very end, after making sure there are no * pending bus transactions from WLAN SOC for TX/RX.