From b8e1241366d7b4e5e1a7e2cf2b2959fc4610fdf7 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Fri, 12 Jan 2018 16:52:26 +0800 Subject: [PATCH] qcacmn: dump reo ring when flush cache failed When delete peer, host will try to flush all frames in REO queue by sending a cmd through reo ring, but sometimes encounted failure to send this cmd, dump ring status if ecountered above failure. Change-Id: I3ea4e96e5999f85398b531ddf4f350e91e798d70 CRs-Fixed: 2167419 --- hal/wifi3.0/hal_api.h | 6 ++++++ hal/wifi3.0/hal_reo.c | 3 ++- hal/wifi3.0/hal_srng.c | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 8e48b24cc46c..57c0d6b6b503 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -195,6 +195,12 @@ extern uint32_t hal_srng_get_entrysize(void *hal_soc, int ring_type); */ uint32_t hal_srng_max_entries(void *hal_soc, int ring_type); +/** + * hal_srng_dump - Dump ring status + * @srng: hal srng pointer + */ +void hal_srng_dump(struct hal_srng *srng); + /** * hal_srng_get_dir - Returns the direction of the ring * @hal_soc: Opaque HAL SOC handle diff --git a/hal/wifi3.0/hal_reo.c b/hal/wifi3.0/hal_reo.c index e617fae3decf..d4d619e9dc9e 100644 --- a/hal/wifi3.0/hal_reo.c +++ b/hal/wifi3.0/hal_reo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 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 @@ -192,6 +192,7 @@ inline int hal_reo_cmd_flush_cache(void *reo_ring, struct hal_soc *soc, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG, "%s: Out of cmd ring entries\n", __func__); hal_srng_access_end(soc, reo_ring); + hal_srng_dump(reo_ring); return -EBUSY; } diff --git a/hal/wifi3.0/hal_srng.c b/hal/wifi3.0/hal_srng.c index c5bae9e05d7c..04df0ffdcb2c 100644 --- a/hal/wifi3.0/hal_srng.c +++ b/hal/wifi3.0/hal_srng.c @@ -1330,6 +1330,29 @@ enum hal_srng_dir hal_srng_get_dir(void *hal_soc, int ring_type) return ring_config->ring_dir; } +/** + * hal_srng_dump - Dump ring status + * @srng: hal srng pointer + */ +void hal_srng_dump(struct hal_srng *srng) +{ + if (srng->ring_dir == HAL_SRNG_SRC_RING) { + qdf_print("=== SRC RING %d ===", srng->ring_id); + qdf_print("hp %u, reap_hp %u, tp %u, cached tp %u", + srng->u.src_ring.hp, + srng->u.src_ring.reap_hp, + *srng->u.src_ring.tp_addr, + srng->u.src_ring.cached_tp); + } else { + qdf_print("=== DST RING %d ===", srng->ring_id); + qdf_print("tp %u, hp %u, cached tp %u, loop_cnt %u", + srng->u.dst_ring.tp, + *srng->u.dst_ring.hp_addr, + srng->u.dst_ring.cached_hp, + srng->u.dst_ring.loop_cnt); + } +} + /** * hal_get_srng_params - Retreive SRNG parameters for a given ring from HAL *