qcacmn: Register DP, HTC, HAL modules with Runtime PM module

With restructuring in HIF runtime PM module, modules are
required to register with the HIF runtime PM module. Also,
changes are done in functions of allowing and preventing
runtime PM suspend as part of restructuring.
This change registers DP, HTC and HAL internal modules
with runtime PM module and update HIF runtime PM function
calls with the restructured code of HIF runtime PM module.

Change-Id: I8899a1d3b92a90a05c5eaf4df7609f4008f739f8
CRs-Fixed: 3169372
This commit is contained in:
Ananya Gupta
2022-03-22 13:29:10 +05:30
committed by Madan Koyyalamudi
parent 4021d4b379
commit 8565e7029f
15 changed files with 134 additions and 200 deletions

View File

@@ -1548,10 +1548,8 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
return;
}
ret = hif_pm_runtime_get(soc->hif_handle,
RTPM_ID_DW_TX_HW_ENQUEUE, true);
switch (ret) {
case 0:
ret = hif_rtpm_get(HIF_RTPM_GET_ASYNC, HIF_RTPM_ID_DP);
if (QDF_IS_STATUS_SUCCESS(ret)) {
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);
@@ -1559,31 +1557,8 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
} else {
dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
}
hif_pm_runtime_put(soc->hif_handle,
RTPM_ID_DW_TX_HW_ENQUEUE);
break;
/*
* If hif_pm_runtime_get returns -EBUSY or -EINPROGRESS,
* take the dp runtime refcount using dp_runtime_get,
* check link state,if up, write TX ring HP, else just set flush event.
* In dp_runtime_resume, wait until dp runtime refcount becomes
* zero or time out, then flush pending tx.
*/
case -EBUSY:
case -EINPROGRESS:
dp_runtime_get(soc);
if (hif_pm_get_link_state(soc->hif_handle) ==
HIF_PM_LINK_STATE_UP) {
dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
} else {
dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);
qdf_atomic_inc(&soc->tx_pending_rtpm);
hal_srng_inc_flush_cnt(hal_ring_hdl);
}
dp_runtime_put(soc);
break;
default:
hif_rtpm_put(HIF_RTPM_PUT_ASYNC, HIF_RTPM_ID_DP);
} else {
dp_runtime_get(soc);
dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);