From 8ee9b29721f6873baa2bc85a4178b3168b9d2595 Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Fri, 6 Nov 2020 19:46:53 +0530 Subject: [PATCH] qcacld-3.0: Retry sending packets in htc queue A race condition is observed when runtime suspend is aborted due to pending TX packets but context switch happened and pm_state did not revert to active state yet. In parallel, WMI_PEER_DELETE command is queued but not sent as pm_state is still in suspending state. To fix this, schedule HTC queue kicker work to resend pending commands again after dp_runtime_suspend aborts due to pending TX packets. Change-Id: I6d2c4140a4635c0aec304f48b15fb2b539ac39ea CRs-Fixed: 2813657 --- components/pmo/core/src/wlan_pmo_suspend_resume.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index 7aad1cc75189..61ea4b3aac34 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -1011,7 +1011,7 @@ QDF_STATUS pmo_core_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc *psoc, ret = hif_pre_runtime_suspend(hif_ctx); if (ret) { status = qdf_status_from_os_return(ret); - goto runtime_failure; + goto pre_runtime_failure; } status = cdp_runtime_suspend(dp_soc, pdev_id); @@ -1081,13 +1081,20 @@ pmo_resume_configure: resume_htc: PMO_CORE_PSOC_RUNTIME_PM_QDF_BUG(QDF_STATUS_SUCCESS != pmo_tgt_psoc_set_runtime_pm_inprogress(psoc, false)); - PMO_CORE_PSOC_RUNTIME_PM_QDF_BUG(htc_runtime_resume(htc_ctx)); cdp_runtime_resume: PMO_CORE_PSOC_RUNTIME_PM_QDF_BUG(QDF_STATUS_SUCCESS != cdp_runtime_resume(dp_soc, pdev_id)); +/* + * A race condition was observed where htc_try_send was called before + * runtime pm state was set to active and it was not called again. + * Schedule HTC queue kicker here to send the pending commands. + */ runtime_failure: + PMO_CORE_PSOC_RUNTIME_PM_QDF_BUG(htc_runtime_resume(htc_ctx)); + +pre_runtime_failure: hif_process_runtime_suspend_failure(hif_ctx); dec_psoc_ref: