From 90e0b5fd60e25ac0a3f954689ed8ee94a462378b Mon Sep 17 00:00:00 2001 From: Mukesh Kumar Savaliya Date: Sat, 19 Jun 2021 02:32:22 +0530 Subject: [PATCH] dmaengine: gpi: Add support to dump GPI registers by clients This is to add gpi register dump support where clients can directly call the API to dump GSI registers. This helps debug when GSI transfer has any issue like timeout, no callback etc at the client driver and want to dump register directly based on the need. Change-Id: I1d9fadd51ccea166f2a486e84a8de47c134e435b Signed-off-by: Mukesh Kumar Savaliya --- drivers/dma/qcom/gpi.c | 9 +++++++++ include/linux/msm_gpi.h | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c index b0bb1f9b55e8..44e2e7de129e 100644 --- a/drivers/dma/qcom/gpi.c +++ b/drivers/dma/qcom/gpi.c @@ -852,6 +852,15 @@ static void gpi_dump_debug_reg(struct gpii *gpii) GPII_ERR(gpii, GPI_DBG_COMMON, "Global IRQ handling Exit\n"); } +void gpi_dump_for_geni(struct dma_chan *chan) +{ + struct gpii_chan *gpii_chan = to_gpii_chan(chan); + struct gpii *gpii = gpii_chan->gpii; + + gpi_dump_debug_reg(gpii); +} +EXPORT_SYMBOL(gpi_dump_for_geni); + static void gpi_disable_interrupts(struct gpii *gpii) { struct { diff --git a/include/linux/msm_gpi.h b/include/linux/msm_gpi.h index d254c0355ebf..d96bc36e9bbe 100644 --- a/include/linux/msm_gpi.h +++ b/include/linux/msm_gpi.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #ifndef __MSM_GPI_H_ @@ -263,4 +263,8 @@ struct msm_gpi_dma_async_tx_cb_param { void *userdata; }; +/* Client drivers of the GPI can call this function to dump the GPI registers + * whenever client met some scenario like timeout, error in GPI transfer mode. + */ +void gpi_dump_for_geni(struct dma_chan *chan); #endif