diff --git a/dp/inc/cdp_txrx_misc.h b/dp/inc/cdp_txrx_misc.h index 0adb23947bd9..16d034077c47 100644 --- a/dp/inc/cdp_txrx_misc.h +++ b/dp/inc/cdp_txrx_misc.h @@ -863,4 +863,23 @@ cdp_soc_is_swlm_enabled(ol_txrx_soc_handle soc) return 0; } + +/** + * cdp_display_txrx_hw_info() - Dump the DP rings info + * @soc: soc handle + * + * Return: none + */ +static inline void +cdp_display_txrx_hw_info(ol_txrx_soc_handle soc) +{ + if (!soc || !soc->ops || !soc->ops->misc_ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + return; + } + + if (soc->ops->misc_ops->display_txrx_hw_info) + return soc->ops->misc_ops->display_txrx_hw_info(soc); +} #endif /* _CDP_TXRX_MISC_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 0c01400345fb..cd9a4e295a73 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1190,6 +1190,7 @@ struct ol_if_ops { * for this particular vdev. * @set_swlm_enable: Enable or Disable Software Latency Manager. * @is_swlm_enabled: Check if Software latency manager is enabled or not. + * @display_txrx_hw_info: Dump the DP rings info * * Function pointers for miscellaneous soc/pdev/vdev related operations. */ @@ -1278,6 +1279,7 @@ struct cdp_misc_ops { QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl, uint8_t val); uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl); + void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl); }; /** diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 0e7db74fbb8a..ba59361376c3 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -10146,6 +10146,50 @@ static uint8_t dp_soc_is_swlm_enabled(struct cdp_soc_t *soc_hdl) } #endif +/** + * dp_display_srng_info() - Dump the srng HP TP info + * @soc_hdl: CDP Soc handle + * + * This function dumps the SW hp/tp values for the important rings. + * HW hp/tp values are not being dumped, since it can lead to + * READ NOC error when UMAC is in low power state. MCC does not have + * device force wake working yet. + * + * Return: none + */ +static void dp_display_srng_info(struct cdp_soc_t *soc_hdl) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + hal_soc_handle_t hal_soc = soc->hal_soc; + uint32_t hp, tp, i; + + dp_info("SRNG HP-TP data:"); + for (i = 0; i < soc->num_tcl_data_rings; i++) { + hal_get_sw_hptp(hal_soc, soc->tcl_data_ring[i].hal_srng, + &hp, &tp); + dp_info("TCL DATA ring[%d]: hp=0x%x, tp=0x%x", i, hp, tp); + + hal_get_sw_hptp(hal_soc, soc->tx_comp_ring[i].hal_srng, + &hp, &tp); + dp_info("TX comp ring[%d]: hp=0x%x, tp=0x%x", i, hp, tp); + } + + for (i = 0; i < soc->num_reo_dest_rings; i++) { + hal_get_sw_hptp(hal_soc, soc->reo_dest_ring[i].hal_srng, + &hp, &tp); + dp_info("REO DST ring[%d]: hp=0x%x, tp=0x%x", i, hp, tp); + } + + hal_get_sw_hptp(hal_soc, soc->reo_exception_ring.hal_srng, &hp, &tp); + dp_info("REO exception ring: hp=0x%x, tp=0x%x", hp, tp); + + hal_get_sw_hptp(hal_soc, soc->rx_rel_ring.hal_srng, &hp, &tp); + dp_info("WBM RX release ring: hp=0x%x, tp=0x%x", hp, tp); + + hal_get_sw_hptp(hal_soc, soc->wbm_desc_rel_ring.hal_srng, &hp, &tp); + dp_info("WBM desc release ring: hp=0x%x, tp=0x%x", hp, tp); +} + /** * dp_soc_get_dp_txrx_handle() - get context for external-dp from dp soc * @soc_handle: datapath soc handle @@ -11534,6 +11578,7 @@ static struct cdp_misc_ops dp_ops_misc = { .set_swlm_enable = dp_soc_set_swlm_enable, .is_swlm_enabled = dp_soc_is_swlm_enabled, #endif + .display_txrx_hw_info = dp_display_srng_info, }; #endif