diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-23 12:40:56 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-09-08 14:23:03 -0400 |
commit | be7852a839b6dcd86db1a2d25b9a1a99f38db2db (patch) | |
tree | 9ecd429f529c524bae5bd2bbdfe47364a4cbe106 /drivers/spi | |
parent | c3f139b65585a5f29df47b2302ff8dbd9bdad0b0 (diff) |
spi/spi_s3c64xx: Warn if PIO transfers time out
When using PIO we have a timeout for the TX and RX FIFOs to ensure that
the data actually gets transferred. Warn if we hit that timeout - it
should never happen, but this makes sure we'll find out if it does.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi_s3c64xx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c index ef9dacabe062..c3038da2648a 100644 --- a/drivers/spi/spi_s3c64xx.c +++ b/drivers/spi/spi_s3c64xx.c | |||
@@ -200,6 +200,9 @@ static void flush_fifo(struct s3c64xx_spi_driver_data *sdd) | |||
200 | val = readl(regs + S3C64XX_SPI_STATUS); | 200 | val = readl(regs + S3C64XX_SPI_STATUS); |
201 | } while (TX_FIFO_LVL(val, sci) && loops--); | 201 | } while (TX_FIFO_LVL(val, sci) && loops--); |
202 | 202 | ||
203 | if (loops == 0) | ||
204 | dev_warn(&sdd->pdev->dev, "Timed out flushing TX FIFO\n"); | ||
205 | |||
203 | /* Flush RxFIFO*/ | 206 | /* Flush RxFIFO*/ |
204 | loops = msecs_to_loops(1); | 207 | loops = msecs_to_loops(1); |
205 | do { | 208 | do { |
@@ -210,6 +213,9 @@ static void flush_fifo(struct s3c64xx_spi_driver_data *sdd) | |||
210 | break; | 213 | break; |
211 | } while (loops--); | 214 | } while (loops--); |
212 | 215 | ||
216 | if (loops == 0) | ||
217 | dev_warn(&sdd->pdev->dev, "Timed out flushing RX FIFO\n"); | ||
218 | |||
213 | val = readl(regs + S3C64XX_SPI_CH_CFG); | 219 | val = readl(regs + S3C64XX_SPI_CH_CFG); |
214 | val &= ~S3C64XX_SPI_CH_SW_RST; | 220 | val &= ~S3C64XX_SPI_CH_SW_RST; |
215 | writel(val, regs + S3C64XX_SPI_CH_CFG); | 221 | writel(val, regs + S3C64XX_SPI_CH_CFG); |