qcacmn: Check for tx desc leak or corruption

Tx descriptor is not being freed and put back in tx desc
pool for a long time. As a result, system is not going
into suspended state.
To find this descriptor, during dp_bus_suspend and
dp_runtime_suspend, parse through the descriptor pool to
check for any descriptors not freed for a long and trigger
self recovery when found.

Change-Id: Id97c5c8537c9bec922f4e254b5bf094505ee61ff
CRs-Fixed: 3109868
这个提交包含在:
Ananya Gupta
2022-01-14 08:20:37 +05:30
提交者 Madan Koyyalamudi
父节点 d3e9c9ca97
当前提交 940984c6a6
修改 8 个文件,包含 169 行新增6 行删除

查看文件

@@ -4540,6 +4540,17 @@ dp_srng_test_and_update_nf_params(struct dp_soc *soc, struct dp_srng *dp_srng,
}
#endif
#ifdef DP_TX_TRACKING
void dp_tx_desc_check_corruption(struct dp_tx_desc_s *tx_desc)
{
if ((tx_desc->magic != DP_TX_MAGIC_PATTERN_INUSE) &&
(tx_desc->magic != DP_TX_MAGIC_PATTERN_FREE)) {
dp_err_rl("tx_desc %u is corrupted", tx_desc->id);
qdf_trigger_self_recovery(NULL, QDF_TX_DESC_LEAK);
}
}
#endif
uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
uint32_t quota)
@@ -4685,6 +4696,7 @@ more_data:
dp_tx_comp_info_rl("Descriptor freed in vdev_detach %d",
tx_desc->id);
DP_STATS_INC(soc, tx.tx_comp_exception, 1);
dp_tx_desc_check_corruption(tx_desc);
continue;
}