From 638ff0c744a108a2cf9bc5426a0e231025f4ecef Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Wed, 22 Apr 2020 15:18:32 +0800 Subject: [PATCH] qcacld-3.0: Supsend fw firstly when ready event timeout In case wait for ready event timeout from fw, need to suspend fw firstly, otherwise fw is not aware host will free resources. Change-Id: Ifb7ab7fcf0cf468d59dc462dfdb27851fa4e596e CRs-Fixed: 2669433 --- core/cds/src/cds_api.c | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index ae7091e4864e..485d5367b316 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -891,6 +891,26 @@ close: return QDF_STATUS_E_FAILURE; } +#ifdef HIF_USB +static inline void cds_suspend_target(tp_wma_handle wma_handle) +{ + QDF_STATUS status; + /* Suspend the target and disable interrupt */ + status = ucfg_pmo_psoc_suspend_target(wma_handle->psoc, 0); + if (status) + cds_err("Failed to suspend target, status = %d", status); +} +#else +static inline void cds_suspend_target(tp_wma_handle wma_handle) +{ + QDF_STATUS status; + /* Suspend the target and disable interrupt */ + status = ucfg_pmo_psoc_suspend_target(wma_handle->psoc, 1); + if (status) + cds_err("Failed to suspend target, status = %d", status); +} +#endif /* HIF_USB */ + /** * cds_pre_enable() - pre enable cds * @@ -963,6 +983,12 @@ QDF_STATUS cds_pre_enable(void) return QDF_STATUS_SUCCESS; stop_wmi: + /* Send pdev suspend to fw otherwise FW is not aware that + * host is freeing resources. + */ + if (!(cds_is_driver_recovering() || cds_is_driver_in_bad_state())) + cds_suspend_target(gp_cds_context->wma_context); + hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) cds_err("%s: Failed to get hif_handle!", __func__); @@ -1128,26 +1154,6 @@ QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc) return qdf_status; } -#ifdef HIF_USB -static inline void cds_suspend_target(tp_wma_handle wma_handle) -{ - QDF_STATUS status; - /* Suspend the target and disable interrupt */ - status = ucfg_pmo_psoc_suspend_target(wma_handle->psoc, 0); - if (status) - cds_err("Failed to suspend target, status = %d", status); -} -#else -static inline void cds_suspend_target(tp_wma_handle wma_handle) -{ - QDF_STATUS status; - /* Suspend the target and disable interrupt */ - status = ucfg_pmo_psoc_suspend_target(wma_handle->psoc, 1); - if (status) - cds_err("Failed to suspend target, status = %d", status); -} -#endif /* HIF_USB */ - /** * cds_post_disable() - post disable cds module *