Эх сурвалжийг харах

qcacmn: Check for system PM state before SW2TCL HP update

In SAP mode, intrabss forwarding can happen when system
suspend is in progress. This could potentially result in
a scenario where SW2TCL HP update goes through after
WOW_ENABLE command is sent to FW.

Fix is to check for system PM states and do an explicit
system wakeup if tx packet gets enqueued to SW2TCL after
wow is enabled. Flush the SW2TCL HP on system resume.

Change-Id: I8dcd108b0dc1d703168f2f7a0ef0627e4dc0b103
CRs-Fixed: 3087727
Yeshwanth Sriram Guntuka 3 жил өмнө
parent
commit
454c7361e1

+ 10 - 2
dp/wifi3.0/dp_main.c

@@ -11926,7 +11926,7 @@ static struct cdp_mesh_latency_ops dp_ops_mesh_latency = {
 };
 };
 #endif
 #endif
 
 
-#ifdef FEATURE_RUNTIME_PM
+#if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
 /**
 /**
  * dp_flush_ring_hptp() - Update ring shadow
  * dp_flush_ring_hptp() - Update ring shadow
  *			  register HP/TP address when runtime
  *			  register HP/TP address when runtime
@@ -11946,11 +11946,13 @@ void dp_flush_ring_hptp(struct dp_soc *soc, hal_ring_handle_t hal_srng)
 		hal_srng_access_end(soc->hal_soc, hal_srng);
 		hal_srng_access_end(soc->hal_soc, hal_srng);
 
 
 		hal_srng_set_flush_last_ts(hal_srng);
 		hal_srng_set_flush_last_ts(hal_srng);
-		qdf_atomic_set(&soc->tx_pending_rtpm, 0);
+
 		dp_debug("flushed");
 		dp_debug("flushed");
 	}
 	}
 }
 }
+#endif
 
 
+#ifdef FEATURE_RUNTIME_PM
 /**
 /**
  * dp_runtime_suspend() - ensure DP is ready to runtime suspend
  * dp_runtime_suspend() - ensure DP is ready to runtime suspend
  * @soc_hdl: Datapath soc handle
  * @soc_hdl: Datapath soc handle
@@ -11985,6 +11987,7 @@ static QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 					   HAL_SRNG_FLUSH_EVENT);
 					   HAL_SRNG_FLUSH_EVENT);
 			dp_flush_ring_hptp(soc, soc->tcl_data_ring[i].hal_srng);
 			dp_flush_ring_hptp(soc, soc->tcl_data_ring[i].hal_srng);
 		}
 		}
+		qdf_atomic_set(&soc->tx_pending_rtpm, 0);
 
 
 		return QDF_STATUS_E_AGAIN;
 		return QDF_STATUS_E_AGAIN;
 	}
 	}
@@ -12035,6 +12038,7 @@ static QDF_STATUS dp_runtime_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 	for (i = 0; i < MAX_TCL_DATA_RINGS; i++) {
 	for (i = 0; i < MAX_TCL_DATA_RINGS; i++) {
 		dp_flush_ring_hptp(soc, soc->tcl_data_ring[i].hal_srng);
 		dp_flush_ring_hptp(soc, soc->tcl_data_ring[i].hal_srng);
 	}
 	}
+	qdf_atomic_set(&soc->tx_pending_rtpm, 0);
 
 
 	dp_flush_ring_hptp(soc, soc->reo_cmd_ring.hal_srng);
 	dp_flush_ring_hptp(soc, soc->reo_cmd_ring.hal_srng);
 	dp_rx_fst_update_pm_suspend_status(soc, false);
 	dp_rx_fst_update_pm_suspend_status(soc, false);
@@ -12487,6 +12491,7 @@ static QDF_STATUS dp_bus_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 {
 {
 	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
 	struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
+	uint8_t i;
 
 
 	if (qdf_unlikely(!pdev)) {
 	if (qdf_unlikely(!pdev)) {
 		dp_err("pdev is NULL");
 		dp_err("pdev is NULL");
@@ -12501,6 +12506,9 @@ static QDF_STATUS dp_bus_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 
 
 	dp_resume_fse_cache_flush(soc);
 	dp_resume_fse_cache_flush(soc);
 
 
+	for (i = 0; i < soc->num_tcl_data_rings; i++)
+		dp_flush_ring_hptp(soc, soc->tcl_data_ring[i].hal_srng);
+
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
 }
 }
 
 

+ 24 - 1
dp/wifi3.0/dp_tx.c

@@ -1479,7 +1479,13 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 				 RTPM_ID_DW_TX_HW_ENQUEUE, true);
 				 RTPM_ID_DW_TX_HW_ENQUEUE, true);
 	switch (ret) {
 	switch (ret) {
 	case 0:
 	case 0:
-		dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
+		if (hif_system_pm_state_check(soc->hif_handle)) {
+			dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
+			hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);
+			hal_srng_inc_flush_cnt(hal_ring_hdl);
+		} else {
+			dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
+		}
 		hif_pm_runtime_put(soc->hif_handle,
 		hif_pm_runtime_put(soc->hif_handle,
 				   RTPM_ID_DW_TX_HW_ENQUEUE);
 				   RTPM_ID_DW_TX_HW_ENQUEUE);
 		break;
 		break;
@@ -1514,6 +1520,23 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 	}
 	}
 }
 }
 #else
 #else
+
+#ifdef DP_POWER_SAVE
+void
+dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
+			      hal_ring_handle_t hal_ring_hdl,
+			      int coalesce)
+{
+	if (hif_system_pm_state_check(soc->hif_handle)) {
+		dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
+		hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);
+		hal_srng_inc_flush_cnt(hal_ring_hdl);
+	} else {
+		dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
+	}
+}
+#endif
+
 static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
 static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
 {
 {
 	return 0;
 	return 0;

+ 7 - 0
dp/wifi3.0/dp_tx.h

@@ -756,6 +756,12 @@ void dp_set_rtpm_tput_policy_requirement(struct cdp_soc_t *soc_hdl,
 	qdf_atomic_set(&soc->rtpm_high_tput_flag, is_high_tput);
 	qdf_atomic_set(&soc->rtpm_high_tput_flag, is_high_tput);
 }
 }
 
 
+void
+dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
+			      hal_ring_handle_t hal_ring_hdl,
+			      int coalesce);
+#else
+#ifdef DP_POWER_SAVE
 void
 void
 dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 			      hal_ring_handle_t hal_ring_hdl,
 			      hal_ring_handle_t hal_ring_hdl,
@@ -768,6 +774,7 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 {
 {
 	dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
 	dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
 }
 }
+#endif
 
 
 static inline void
 static inline void
 dp_set_rtpm_tput_policy_requirement(struct cdp_soc_t *soc_hdl,
 dp_set_rtpm_tput_policy_requirement(struct cdp_soc_t *soc_hdl,