qcacmn: suspend/resume changes for WCN6450
Changes required for suspend/resume support for WCN6450 Change-Id: I4610f6bdb8de92f03884af6c07a5141dd27174be CRs-Fixed: 3447469
此提交包含在:

提交者
Madan Koyyalamudi

父節點
476546a791
當前提交
26099afe23
@@ -10679,6 +10679,93 @@ inline void dp_find_missing_tx_comp(struct dp_soc *soc)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
/**
|
||||
* dp_runtime_suspend() - ensure DP is ready to runtime suspend
|
||||
* @soc_hdl: Datapath soc handle
|
||||
* @pdev_id: id of data path pdev handle
|
||||
*
|
||||
* DP is ready to runtime suspend if there are no pending TX packets.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_pdev *pdev;
|
||||
int32_t tx_pending;
|
||||
|
||||
pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||
if (!pdev) {
|
||||
dp_err("pdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
/* Abort if there are any pending TX packets */
|
||||
tx_pending = dp_get_tx_pending(dp_pdev_to_cdp_pdev(pdev));
|
||||
if (tx_pending) {
|
||||
dp_info_rl("%pK: Abort suspend due to pending TX packets %d",
|
||||
soc, tx_pending);
|
||||
dp_find_missing_tx_comp(soc);
|
||||
/* perform a force flush if tx is pending */
|
||||
soc->arch_ops.dp_update_ring_hptp(soc, true);
|
||||
qdf_atomic_set(&soc->tx_pending_rtpm, 0);
|
||||
|
||||
return QDF_STATUS_E_AGAIN;
|
||||
}
|
||||
|
||||
if (dp_runtime_get_refcount(soc)) {
|
||||
dp_init_info("refcount: %d", dp_runtime_get_refcount(soc));
|
||||
|
||||
return QDF_STATUS_E_AGAIN;
|
||||
}
|
||||
|
||||
if (soc->intr_mode == DP_INTR_POLL)
|
||||
qdf_timer_stop(&soc->int_timer);
|
||||
|
||||
dp_rx_fst_update_pm_suspend_status(soc, true);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define DP_FLUSH_WAIT_CNT 10
|
||||
#define DP_RUNTIME_SUSPEND_WAIT_MS 10
|
||||
/**
|
||||
* dp_runtime_resume() - ensure DP is ready to runtime resume
|
||||
* @soc_hdl: Datapath soc handle
|
||||
* @pdev_id: id of data path pdev handle
|
||||
*
|
||||
* Resume DP for runtime PM.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS dp_runtime_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
int suspend_wait = 0;
|
||||
|
||||
if (soc->intr_mode == DP_INTR_POLL)
|
||||
qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);
|
||||
|
||||
/*
|
||||
* Wait until dp runtime refcount becomes zero or time out, then flush
|
||||
* pending tx for runtime suspend.
|
||||
*/
|
||||
while (dp_runtime_get_refcount(soc) &&
|
||||
suspend_wait < DP_FLUSH_WAIT_CNT) {
|
||||
qdf_sleep(DP_RUNTIME_SUSPEND_WAIT_MS);
|
||||
suspend_wait++;
|
||||
}
|
||||
|
||||
soc->arch_ops.dp_update_ring_hptp(soc, false);
|
||||
qdf_atomic_set(&soc->tx_pending_rtpm, 0);
|
||||
|
||||
dp_rx_fst_update_pm_suspend_status(soc, false);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* FEATURE_RUNTIME_PM */
|
||||
|
||||
/**
|
||||
* dp_tx_get_success_ack_stats() - get tx success completion count
|
||||
* @soc_hdl: Datapath soc handle
|
||||
@@ -11174,7 +11261,6 @@ 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_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||
uint8_t i;
|
||||
|
||||
if (qdf_unlikely(!pdev)) {
|
||||
dp_err("pdev is NULL");
|
||||
@@ -11189,10 +11275,8 @@ static QDF_STATUS dp_bus_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
||||
|
||||
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);
|
||||
soc->arch_ops.dp_update_ring_hptp(soc, false);
|
||||
|
||||
dp_flush_ring_hptp(soc, soc->reo_cmd_ring.hal_srng);
|
||||
dp_rx_fst_update_pm_suspend_status(soc, false);
|
||||
|
||||
dp_rx_fst_requeue_wq(soc);
|
||||
|
新增問題並參考
封鎖使用者