From 4e94e6a59213dc51a8d25315628960161a80d5a0 Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Mon, 31 Oct 2022 21:53:22 -0700 Subject: [PATCH] qcacld-3.0: Disable FISA update in suspend state FISA update may come when target in suspend state, then UMAC force wake may return failure and lead to system timeout crash. Change is used to defer the update when resume happens. Change-Id: I8d3082355f780d11fd5047d67f916f0a7dd0c6e8 CRs-Fixed: 3325498 --- components/dp/core/src/wlan_dp_fisa_rx.c | 16 +++++++++++++-- components/dp/core/src/wlan_dp_rx_fst.c | 25 ++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/components/dp/core/src/wlan_dp_fisa_rx.c b/components/dp/core/src/wlan_dp_fisa_rx.c index eb4f3c5495..7f2cc7806b 100644 --- a/components/dp/core/src/wlan_dp_fisa_rx.c +++ b/components/dp/core/src/wlan_dp_fisa_rx.c @@ -915,6 +915,12 @@ void dp_fisa_rx_fst_update_work(void *arg) qdf_list_node_t *node; hal_soc_handle_t hal_soc_hdl = fisa_hdl->soc_hdl->hal_soc; + if (qdf_atomic_read(&fisa_hdl->pm_suspended)) { + dp_err_rl("WQ triggered during suspend stage, deferred update"); + DP_STATS_INC(fisa_hdl, update_deferred, 1); + return; + } + if (hif_force_wake_request(((struct hal_soc *)hal_soc_hdl)->hif_handle)) { dp_err("Wake up request failed"); qdf_check_state_before_panic(__func__, __LINE__); @@ -1043,8 +1049,14 @@ dp_fisa_rx_queue_fst_update_work(struct dp_rx_fst *fisa_hdl, uint32_t flow_idx, qdf_list_insert_back(&fisa_hdl->fst_update_list, &elem->node); qdf_spin_unlock_bh(&fisa_hdl->dp_rx_fst_lock); - qdf_queue_work(fisa_hdl->soc_hdl->osdev, fisa_hdl->fst_update_wq, - &fisa_hdl->fst_update_work); + if (qdf_atomic_read(&fisa_hdl->pm_suspended)) { + fisa_hdl->fst_wq_defer = true; + dp_info("defer fst update task in WoW"); + } else { + qdf_queue_work(fisa_hdl->soc_hdl->osdev, + fisa_hdl->fst_update_wq, + &fisa_hdl->fst_update_work); + } return NULL; } diff --git a/components/dp/core/src/wlan_dp_rx_fst.c b/components/dp/core/src/wlan_dp_rx_fst.c index 4850abaf5c..6fc253b983 100644 --- a/components/dp/core/src/wlan_dp_rx_fst.c +++ b/components/dp/core/src/wlan_dp_rx_fst.c @@ -81,6 +81,7 @@ void dp_print_fisa_stats(struct dp_soc *soc) return; dp_info("invalid flow index: %u", fst->stats.invalid_flow_index); + dp_info("workqueue update deferred: %u", fst->stats.update_deferred); dp_info("reo_mismatch: cce_match: %u", fst->stats.reo_mismatch.allow_cce_match); dp_info("reo_mismatch: allow_fse_metdata_mismatch: %u", @@ -135,7 +136,7 @@ static void dp_fisa_fse_cache_flush_timer(void *arg) if (!fisa_hdl) return; - if (fisa_hdl->pm_suspended) { + if (qdf_atomic_read(&fisa_hdl->pm_suspended)) { qdf_atomic_set(&fisa_hdl->fse_cache_flush_posted, 0); return; } @@ -375,6 +376,7 @@ QDF_STATUS dp_rx_fst_attach(struct dp_soc *soc, struct dp_pdev *pdev) soc->fisa_lru_del_enable = wlan_cfg_is_rx_fisa_lru_del_enabled(cfg); qdf_atomic_init(&soc->skip_fisa_param.skip_fisa); + qdf_atomic_init(&fst->pm_suspended); QDF_TRACE(QDF_MODULE_ID_ANY, QDF_TRACE_LEVEL_ERROR, "Rx FST attach successful, #entries:%d\n", @@ -546,8 +548,27 @@ void dp_rx_fst_update_pm_suspend_status(struct dp_soc *soc, bool suspended) if (!fst) return; - fst->pm_suspended = suspended; + if (suspended) + qdf_atomic_set(&fst->pm_suspended, 1); + else + qdf_atomic_set(&fst->pm_suspended, 0); } + +void dp_rx_fst_requeue_wq(struct dp_soc *soc) +{ + struct dp_rx_fst *fst = soc->rx_fst; + + if (!fst || !fst->fst_wq_defer) + return; + + fst->fst_wq_defer = false; + qdf_queue_work(fst->soc_hdl->osdev, + fst->fst_update_wq, + &fst->fst_update_work); + + dp_info("requeued defer fst update task"); +} + #else /* WLAN_SUPPORT_RX_FISA */ #endif /* !WLAN_SUPPORT_RX_FISA */