spi: s3c64xx: print DMA register dump on timeout error
authorJung-Ick Guack <ji.guack@samsung.com>
Thu, 14 Jul 2016 04:39:21 +0000 (13:39 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
Change-Id: Iccb09fa443ea604d757ccc96b1a602964bbea9e9
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
drivers/spi/spi-s3c64xx.c

index b241c7694e1403f6beaac3885c4e49d0380417e2..695d37e66e561ea6426aa34caee1aefd2421ed8d 100644 (file)
@@ -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);