1
0

qcacmn: Handle RTPM counter for opt wifi dp

Inorder to keep the PCIe link up during
optional wifi dp transfer the
hif_force_wake_request() is called during
filter addition. This increments the rtpm_get counter.
Now if Wifi is disconnected before releasing the
filters, the corresponding hif_force_wake_release()
call is not made. This causes a mismatch in RTPM GET and
PUT calls and triggers an assert during hdd_wlan_stop_modules().
This change adds a cleanup call to release the force wake
and reduce the rtpm_put counter to prevent the assert.

Change-Id: Idd778275a015922376cf7eb0a7c3d92e75881fe8
CRs-Fixed: 3441186
Este cometimento está contido em:
Namita Nair
2023-03-20 18:36:08 -07:00
cometido por Madan Koyyalamudi
ascendente 2bea262d35
cometimento 42381bb34d
4 ficheiros modificados com 101 adições e 36 eliminações

Ver ficheiro

@@ -347,6 +347,9 @@ struct hif_softc {
#endif /*defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)*/
#ifdef IPA_OFFLOAD
qdf_shared_mem_t *ipa_ce_ring;
#endif
#ifdef IPA_OPT_WIFI_DP
qdf_atomic_t opt_wifi_dp_rtpm_cnt;
#endif
struct hif_cfg ini_cfg;
#ifdef HIF_CE_LOG_INFO

Ver ficheiro

@@ -4290,11 +4290,36 @@ void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
#ifdef IPA_OPT_WIFI_DP
int hif_prevent_l1(struct hif_opaque_softc *hif)
{
return hif_force_wake_request(hif);
struct hif_softc *hif_softc = (struct hif_softc *)hif;
int status;
status = hif_force_wake_request(hif);
if (status) {
hif_err("Force wake request error");
return status;
}
qdf_atomic_inc(&hif_softc->opt_wifi_dp_rtpm_cnt);
hif_info("opt_dp: pcie link up count %d",
qdf_atomic_read(&hif_softc->opt_wifi_dp_rtpm_cnt));
return status;
}
void hif_allow_l1(struct hif_opaque_softc *hif)
{
hif_force_wake_release(hif);
struct hif_softc *hif_softc = (struct hif_softc *)hif;
int status;
if (qdf_atomic_read(&hif_softc->opt_wifi_dp_rtpm_cnt) > 0) {
status = hif_force_wake_release(hif);
if (status) {
hif_err("Force wake release error");
return;
}
qdf_atomic_dec(&hif_softc->opt_wifi_dp_rtpm_cnt);
hif_info("opt_dp: pcie link down count %d",
qdf_atomic_read(&hif_softc->opt_wifi_dp_rtpm_cnt));
}
}
#endif