From 7d2afb4d628ab2e75a342de0872b9b41eb79e13e Mon Sep 17 00:00:00 2001 From: Sravan Goud Date: Wed, 16 Oct 2019 21:26:32 +0530 Subject: [PATCH] qcacmn: Do panic if pci wake request fails During hal write register first device force wakeup request is done. If force wakeup request fails register write is not done and the execution continues. This leads to NOC erros in REO ramap register cases. As in later point of time packets will be coming on wrong reo2sw ring and at the destination side channels are not enabled. When NOC error happens the current system is of no help to root cause as the write fail happened way before. So do panic if pci wake request fails which help to root cause the reason for failure. Change-Id: I30d3f0a7858f3d4af96a80f69ba59764c9a7c8e9 CRs-Fixed: 2541061 --- hal/wifi3.0/hal_api.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 58df360dfd..20d2fc0828 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -84,10 +84,12 @@ static inline int hal_force_wake_release(struct hal_soc *soc) static inline int hal_force_wake_request(struct hal_soc *soc) { uint32_t timeout = 0; + int ret; - if (pld_force_wake_request(soc->qdf_dev->dev)) { + ret = pld_force_wake_request(soc->qdf_dev->dev); + if (ret) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "%s: Request send failed \n", __func__); + "%s: Request send failed %d\n", __func__, ret); return -EINVAL; } @@ -155,11 +157,17 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset, static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset, uint32_t value) { - if ((offset > MAPPED_REF_OFF) && - hal_force_wake_request(hal_soc)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "%s: Wake up request failed\n", __func__); - return; + int ret; + + if (offset > MAPPED_REF_OFF) { + ret = hal_force_wake_request(hal_soc); + if (ret) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + "%s: Wake up request failed %d\n", + __func__, ret); + QDF_BUG(0); + return; + } } if (!hal_soc->use_register_windowing ||