From 584440c8d1c0ee2b1dc10b81db7b33d99eb0443e Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Fri, 26 Jun 2020 15:34:14 +0530 Subject: [PATCH] qcacld-3.0: Assert early on to enable dump info collection Presently, in the host initiated recovery the handler checks whether the support for recovery is enabled via the ini or triggers the panic. Whenever the panic is triggered the irq's will be disabled, this results in some targets not able to collect the important MHI, PCI information on what caused the issue to root cause the issue. So, for different targets check the ini at different places. In this case, move PCI based check to the start. Change-Id: Ia184a265d0f76e43d1d5edc4bcc0849a05726dac CRs-Fixed: 2720999 --- core/cds/src/cds_api.c | 8 -------- core/hdd/src/wlan_hdd_power.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0248d3097230..49282e464e9a 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1916,14 +1916,6 @@ static void cds_trigger_recovery_handler(const char *func, const uint32_t line) cds_force_assert_target(qdf); cds_set_assert_target_in_progress(false); - /* - * if *wlan* recovery is disabled, once all the required registers are - * read via the platform driver check and crash the system. - */ - if (qdf->bus_type == QDF_BUS_TYPE_PCI && !ssr_ini_enabled) - QDF_DEBUG_PANIC("WLAN recovery is not enabled (via %s:%d)", - func, line); - status = qdf_runtime_pm_allow_suspend(&rtl); if (QDF_IS_STATUS_ERROR(status)) cds_err("Failed to release runtime pm lock"); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 31cefedba3b0..377b5ba8d1b2 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1309,6 +1309,8 @@ QDF_STATUS hdd_wlan_shutdown(void) struct hdd_context *hdd_ctx; struct hdd_adapter *adapter; void *soc = cds_get_context(QDF_MODULE_ID_SOC); + qdf_device_t qdf = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + bool ssr_ini_enabled = cds_is_self_recovery_enabled(); hdd_info("WLAN driver shutting down!"); @@ -1319,6 +1321,18 @@ QDF_STATUS hdd_wlan_shutdown(void) return QDF_STATUS_E_FAILURE; } + if (!qdf) { + hdd_err("Qdf context is null"); + return QDF_STATUS_E_INVAL; + } + + /* + * if *wlan* recovery is disabled, once all the required registers are + * read via the platform driver check and crash the system. + */ + if (qdf->bus_type == QDF_BUS_TYPE_PCI && !ssr_ini_enabled) + QDF_DEBUG_PANIC("WLAN recovery is not enabled"); + hdd_set_connection_in_progress(false); policy_mgr_clear_concurrent_session_count(hdd_ctx->psoc);