瀏覽代碼

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
Yu Tian 2 年之前
父節點
當前提交
4e94e6a592
共有 2 個文件被更改,包括 37 次插入4 次删除
  1. 14 2
      components/dp/core/src/wlan_dp_fisa_rx.c
  2. 23 2
      components/dp/core/src/wlan_dp_rx_fst.c

+ 14 - 2
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;
 }

+ 23 - 2
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 */