From e1a85f39d104c0c81aaee9ea4227e5cbd30e5c90 Mon Sep 17 00:00:00 2001 From: Yue Ma Date: Tue, 20 Oct 2015 18:12:45 -0700 Subject: [PATCH] qcacld-3.0: Recover if fail to receive HTC ACK from FW for PDEV suspend qcacld-2.0 to qcacld-3.0 propagation If self-recovery is enabled in ini file, recover if host driver fails to receive HTC ACK from FW for PDEV suspend, otherwise do VOS_BUG. Change-Id: Ieddb22c5806067ec1a1166b60e1642e6cdf74a4c CRs-fixed: 894187 --- core/wma/src/wma_features.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 065f2e300b12..adc553dc79e4 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -5873,11 +5873,22 @@ int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr) uint32_t len = sizeof(*cmd); struct ol_softc *scn; int ret; +#ifdef CONFIG_CNSS + tpAniSirGlobal pmac = cds_get_context(CDF_MODULE_ID_PE); +#endif if (!wma_handle || !wma_handle->wmi_handle) { WMA_LOGE("WMA is closed. can not issue suspend cmd"); return -EINVAL; } + +#ifdef CONFIG_CNSS + if (NULL == pmac) { + WMA_LOGE("%s: Unable to get PE context", __func__); + return -EINVAL; + } +#endif + /* * send the comand to Target to ignore the * PCIE reset so as to ensure that Host and target @@ -5912,6 +5923,13 @@ int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr) != CDF_STATUS_SUCCESS) { WMA_LOGE("Failed to get ACK from firmware for pdev suspend"); wmi_set_target_suspend(wma_handle->wmi_handle, false); +#ifdef CONFIG_CNSS + if (pmac->sme.enableSelfRecovery) { + cds_trigger_recovery(); + } else { + CDF_BUG(0); + } +#endif return -EFAULT; }