From 73c7b7c744a20fd3fc7c0685aafa585d27e0f804 Mon Sep 17 00:00:00 2001 From: chenguo Date: Tue, 22 Jan 2019 14:07:12 +0800 Subject: [PATCH] qcacmn: more debugging information about invaild TX release source 1) Add one counter to track the invaild TX release source 2) Capture he descriptor that caused the issue 3) Print the invalid release source CRs-Fixed: 2380964 Change-Id: I0dc410ae2e7c9df58ef53e3f20ca7979d086659e --- dp/wifi3.0/dp_main.c | 3 ++- dp/wifi3.0/dp_tx.c | 10 ++++++---- dp/wifi3.0/dp_types.h | 3 ++- hal/wifi3.0/hal_tx.h | 23 +++++++++++++++++++++++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 8aedeaa4a9..9c77ca605d 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -6967,7 +6967,8 @@ dp_print_soc_tx_stats(struct dp_soc *soc) soc->stats.tx.tcl_ring_full[0], soc->stats.tx.tcl_ring_full[1], soc->stats.tx.tcl_ring_full[2]); - + DP_PRINT_STATS("Tx invalid completion release = %d", + soc->stats.tx.invalid_release_source); } /** * dp_print_soc_rx_stats: Print SOC level Rx stats diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index ce76d007f5..5b6c102729 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3372,9 +3372,11 @@ uint32_t dp_tx_comp_handler(struct dp_soc *soc, void *hal_srng, uint32_t quota) (buffer_src != HAL_TX_COMP_RELEASE_SOURCE_FW)) { QDF_TRACE(QDF_MODULE_ID_DP, - QDF_TRACE_LEVEL_FATAL, - "Tx comp release_src != TQM | FW"); - + QDF_TRACE_LEVEL_FATAL, + "Tx comp release_src != TQM | FW but from %d", + buffer_src); + hal_dump_comp_desc(tx_comp_hal_desc); + DP_STATS_INC(soc, tx.invalid_release_source, 1); qdf_assert_always(0); } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 81e1e8d1e4..1afb049981 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -592,7 +592,8 @@ struct dp_soc_stats { uint32_t desc_in_use; /* tqm_release_reason == FW removed */ uint32_t dropped_fw_removed; - + /* tx completion release_src != TQM or FW */ + uint32_t invalid_release_source; } tx; /* SOC level RX stats */ diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h index d9725d46fd..de730cc1c9 100644 --- a/hal/wifi3.0/hal_tx.h +++ b/hal/wifi3.0/hal_tx.h @@ -817,6 +817,29 @@ static inline void hal_tx_comp_desc_sync(void *hw_desc, qdf_mem_copy(comp, hw_desc, HAL_TX_COMPLETION_DESC_LEN_BYTES); } +/** + * hal_dump_comp_desc() - dump tx completion descriptor + * @hal_desc: hardware descriptor pointer + * + * This function will print tx completion descriptor + * + * Return: none + */ +static inline void hal_dump_comp_desc(void *hw_desc) +{ + struct hal_tx_desc_comp_s *comp = + (struct hal_tx_desc_comp_s *)hw_desc; + uint32_t i; + + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL, + "Current tx completion descriptor is"); + + for (i = 0; i < HAL_TX_COMPLETION_DESC_LEN_DWORDS; i++) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL, + "DWORD[i] = 0x%x", comp->desc[i]); + } +} + /** * hal_tx_comp_get_htt_desc() - Read the HTT portion of WBM Descriptor * @hal_desc: Hardware (WBM) descriptor pointer