[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200626151800.GA22242@maple.netwinder.org>
Date: Fri, 26 Jun 2020 11:18:00 -0400
From: Ralph Siemsen <ralph.siemsen@...aro.org>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Pavel Machek <pavel@...x.de>,
Serge Semin <fancer.lancer@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Georgy Vlasov <Georgy.Vlasov@...kalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Arnd Bergmann <arnd@...db.de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Feng Tang <feng.tang@...el.com>,
Rob Herring <robh+dt@...nel.org>, linux-mips@...r.kernel.org,
devicetree@...r.kernel.org, Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 182/267] spi: dw: Return any value retrieved from
the dma_transfer callback
Hi Serge, Pavel, Greg,
On Mon, Jun 22, 2020 at 11:51:21PM +0300, Serge Semin wrote:
>Hello Pavel
>
>On Fri, Jun 19, 2020 at 11:07:19PM +0200, Pavel Machek wrote:
>
>> Mainline patch simply changes return value, but code is different in
>> v4.19, and poll_transfer will now be avoided when dws->dma_mapped. Is
>> that a problem?
>
>Actually no.) In that old 4.19 context it's even better to return straight away
>no matter what value is returned by the dma_transfer() callback.
This patch changes the return dma_transfer return value from 0 to 1,
however it was only done in spi-dw-mid.c func mid_spi_dma_transfer().
There is an identical function in spi-dw-mmio.c that needs the same
treatment, otherwise access to the SPI device becomes erratic and even
causes kernel to hang. Guess how I found this ;-)
So the following patch is needed as well, at least in 4.9 and 4.19, I
did not check/test other versions. Mainline does not need this, since
the code seems to have been refactored to avoid the duplication.
Regards,
-Ralph
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index c563c2815093..99641c485288 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -358,7 +358,7 @@ static int mmio_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer)
dma_async_issue_pending(dws->txchan);
}
- return 0;
+ return 1;
}
static void mmio_spi_dma_stop(struct dw_spi *dws)
--
2.17.1
Powered by blists - more mailing lists