From d2bcfc241e5955e9d22a5c95c8365d263ca788ef Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Fri, 9 Oct 2020 12:40:02 -0700 Subject: [PATCH] qcacld-3.0: Use sync API for target assert and dump collection In internal builds, to catch all fw timeout issues, host-initiated self-recovery is not enabled. To avoid a race between cld driver triggering assert and RDDM dump collection, use the CNSS-provided sync API, which guarantees target assert and dump collection before returning. Change-Id: Ib702bfa17616a100913f501f850d5c0b74ad39bb CRs-Fixed: 2790271 --- core/cds/src/cds_api.c | 19 ++++--------------- core/pld/src/pld_pcie.h | 2 +- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 3afc6d353740..6e0c58b889b5 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1976,8 +1976,6 @@ static void cds_trigger_recovery_work(void *context) void __cds_trigger_recovery(enum qdf_hang_reason reason, const char *func, const uint32_t line) { - bool is_work_queue_needed = false; - if (!gp_cds_context) { cds_err("gp_cds_context is null"); return; @@ -1985,19 +1983,10 @@ void __cds_trigger_recovery(enum qdf_hang_reason reason, const char *func, gp_cds_context->recovery_reason = reason; - if (in_atomic() || - (QDF_RESUME_TIMEOUT == reason || QDF_SUSPEND_TIMEOUT == reason)) - is_work_queue_needed = true; - - if (is_work_queue_needed) { - __cds_recovery_caller.func = func; - __cds_recovery_caller.line = line; - qdf_queue_work(0, gp_cds_context->cds_recovery_wq, - &gp_cds_context->cds_recovery_work); - return; - } - - cds_trigger_recovery_handler(func, line); + __cds_recovery_caller.func = func; + __cds_recovery_caller.line = line; + qdf_queue_work(0, gp_cds_context->cds_recovery_wq, + &gp_cds_context->cds_recovery_work); } void cds_trigger_recovery_psoc(void *psoc, enum qdf_hang_reason reason, diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index f03703f10a72..0b20a683ea59 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -625,7 +625,7 @@ static inline int pld_pcie_idle_shutdown(struct device *dev) static inline int pld_pcie_force_assert_target(struct device *dev) { - return cnss_force_fw_assert(dev); + return cnss_force_collect_rddm(dev); } static inline int pld_pcie_get_user_msi_assignment(struct device *dev,