lkml.org 
[lkml]   [2020]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] spi: a3700: fix hang caused by a3700_spi_transfer_one_fifo()
Date
transfer_one() must call spi_finalize_current_transfer() before
returning to inform current transfer has finished. Otherwise spi driver
doesn't issue next transfer, and hang.
However a3700_spi_transfer_one_fifo() doesn't call it if waiting for
"wfifo empty" or "xfer ready" has timed out.
Thus, this patch corrects error handling of them.

Signed-off-by: Daisuke Yamane <yamane07ynct@gmail.com>
---
drivers/spi/spi-armada-3700.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c
index fcde419e480c..1eb2c64386c3 100644
--- a/drivers/spi/spi-armada-3700.c
+++ b/drivers/spi/spi-armada-3700.c
@@ -698,13 +698,15 @@ static int a3700_spi_transfer_one_fifo(struct spi_master *master,
if (!a3700_spi_transfer_wait(spi,
A3700_SPI_WFIFO_EMPTY)) {
dev_err(&spi->dev, "wait wfifo empty timed out\n");
- return -ETIMEDOUT;
+ ret = -ETIMEDOUT;
+ goto error;
}
}

if (!a3700_spi_transfer_wait(spi, A3700_SPI_XFER_RDY)) {
dev_err(&spi->dev, "wait xfer ready timed out\n");
- return -ETIMEDOUT;
+ ret = -ETIMEDOUT;
+ goto error;
}

val = spireg_read(a3700_spi, A3700_SPI_IF_CFG_REG);
--
2.17.1
\
 
 \ /
  Last update: 2020-06-29 21:03    [W:0.059 / U:5.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site