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
Tento commit je obsažen v:
Yu Tian
2022-07-29 02:10:41 -07:00
odevzdal Madan Koyyalamudi
rodič 899d504312
revize 11df417c3b
3 změnil soubory, kde provedl 17 přidání a 1 odebrání

Zobrazit soubor

@@ -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

Zobrazit soubor

@@ -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))

Zobrazit soubor

@@ -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)) {