Răsfoiți Sursa

qcacmn: Add Link stats check before ring access directly

Throughput based RTPM logic of ring access may fail and
lead to NOC error in some corner cases. Change is aimed
to add additional link states check to prevent invalid SRNG
access.

Change-Id: I7e7edbadfd21b4857efa4faff0ada6d94d682f2c
CRs-Fixed: 3256702
Yu Tian 2 ani în urmă
părinte
comite
11df417c3b
3 a modificat fișierele cu 17 adăugiri și 1 ștergeri
  1. 5 1
      dp/wifi3.0/dp_tx.c
  2. 7 0
      hif/inc/hif.h
  3. 5 0
      hif/src/hif_runtime_pm.c

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

@@ -1520,7 +1520,11 @@ dp_tx_check_and_flush_hp(struct dp_soc *soc,
 #ifdef FEATURE_RUNTIME_PM
 static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
 {
-	return qdf_atomic_read(&soc->rtpm_high_tput_flag);
+	int ret;
+
+	ret = qdf_atomic_read(&soc->rtpm_high_tput_flag) &&
+	      (hif_rtpm_get_state() <= HIF_RTPM_STATE_ON);
+	return ret;
 }
 /**
  * dp_tx_ring_access_end_wrapper() - Wrapper for ring access end

+ 7 - 0
hif/inc/hif.h

@@ -1516,6 +1516,13 @@ int hif_runtime_resume(struct hif_opaque_softc *hif_ctx);
  * fastpath only applicable to legacy copy engine
  */
 void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx);
+
+/**
+ * hif_rtpm_get_state(): get rtpm link state
+ *
+ * Return: state
+ */
+int hif_rtpm_get_state(void);
 #else
 static inline
 QDF_STATUS hif_rtpm_register(uint32_t id, void (*hif_rpm_cbk)(void))

+ 5 - 0
hif/src/hif_runtime_pm.c

@@ -1025,6 +1025,11 @@ void hif_rtpm_set_state(enum hif_rtpm_state state)
 	qdf_atomic_set(&gp_hif_rtpm_ctx->pm_state, state);
 }
 
+int hif_rtpm_get_state(void)
+{
+	return qdf_atomic_read(&gp_hif_rtpm_ctx->pm_state);
+}
+
 int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx)
 {
 	if (!hif_can_suspend_link(hif_ctx)) {