From 53809167c6731c011f1398cc26fe8916cb6fa028 Mon Sep 17 00:00:00 2001 From: Jung-Ick Guack Date: Thu, 14 Jul 2016 13:39:21 +0900 Subject: [PATCH] spi: s3c64xx: print DMA register dump on timeout error Change-Id: Iccb09fa443ea604d757ccc96b1a602964bbea9e9 Signed-off-by: Jung-Ick Guack --- drivers/spi/spi-s3c64xx.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b241c7694e14..695d37e66e56 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -505,6 +505,16 @@ static void s3c64xx_spi_dma_stop(struct s3c64xx_spi_driver_data *sdd, #endif } +static void s3c64xx_dma_debug(struct s3c64xx_spi_driver_data *sdd, + struct s3c64xx_spi_dma_data *dma) +{ +#ifdef CONFIG_ARM64 + sdd->ops->debug((unsigned long)dma->ch); +#else + sdd->ops->debug((enum dma_ch)dma->ch); +#endif +} + static void enable_datapath(struct s3c64xx_spi_driver_data *sdd, struct spi_device *spi, struct spi_transfer *xfer, int dma_mode) @@ -1005,11 +1015,15 @@ try_transfer: if (use_dma) { if (xfer->tx_buf != NULL - && (sdd->state & TXBUSY)) + && (sdd->state & TXBUSY)) { + s3c64xx_dma_debug(sdd, &sdd->tx_dma); s3c64xx_spi_dma_stop(sdd, &sdd->tx_dma); + } if (xfer->rx_buf != NULL - && (sdd->state & RXBUSY)) + && (sdd->state & RXBUSY)) { + s3c64xx_dma_debug(sdd, &sdd->rx_dma); s3c64xx_spi_dma_stop(sdd, &sdd->rx_dma); + } } s3c64xx_spi_dump_reg(sdd); -- 2.20.1