diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2016-06-08 09:32:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-10 12:54:47 +0200 |
commit | ef40d3f3739dbee0178624c5a4e6cda3a92af99a (patch) | |
tree | 0bd206ac18daeb72e802dde5ec3e91de6a8a78d6 /drivers/spi | |
parent | 7b1789f9d96d273729dde7e66cb2d80153d53788 (diff) | |
download | lwn-ef40d3f3739dbee0178624c5a4e6cda3a92af99a.tar.gz lwn-ef40d3f3739dbee0178624c5a4e6cda3a92af99a.zip |
spi: rockchip: Signal unfinished DMA transfers
commit 4dc0dd83603f05dc3ae152af33ecb15104c313f3 upstream.
When using DMA, the transfer_one callback should return 1 because the
transfer hasn't finished yet.
A previous commit changed the function to return 0 when the DMA channels
were correctly prepared.
This manifested in Veyron boards with this message:
[ 1.983605] cros-ec-spi spi0.0: EC failed to respond in time
Fixes: ea9849113343 ("spi: rockchip: check return value of dmaengine_prep_slave_sg")
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-rockchip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 6c6c0013ec7a..8048c2fedf5b 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -578,7 +578,7 @@ static int rockchip_spi_transfer_one( struct spi_device *spi, struct spi_transfer *xfer) { - int ret = 1; + int ret = 0; struct rockchip_spi *rs = spi_master_get_devdata(master); WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && @@ -627,6 +627,8 @@ static int rockchip_spi_transfer_one( spi_enable_chip(rs, 1); ret = rockchip_spi_prepare_dma(rs); } + /* successful DMA prepare means the transfer is in progress */ + ret = ret ? ret : 1; } else { spi_enable_chip(rs, 1); ret = rockchip_spi_pio_transfer(rs); |