linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: rockchip: handle zero length transfers without timing out
@ 2021-08-27  5:03 Tobias Schramm
  2021-09-03 15:18 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Schramm @ 2021-08-27  5:03 UTC (permalink / raw)
  To: linux-spi, linux-arm-kernel, linux-rockchip, linux-kernel
  Cc: Mark Brown, Heiko Stuebner, Tobias Schramm

Previously zero length transfers submitted to the Rokchip SPI driver would
time out in the SPI layer. This happens because the SPI peripheral does
not trigger a transfer completion interrupt for zero length transfers.

Fix that by completing zero length transfers immediately at start of
transfer.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
---
 drivers/spi/spi-rockchip.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 540861ca2ba3..553b6b9d0222 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -600,6 +600,12 @@ static int rockchip_spi_transfer_one(
 	int ret;
 	bool use_dma;
 
+	/* Zero length transfers won't trigger an interrupt on completion */
+	if (!xfer->len) {
+		spi_finalize_current_transfer(ctlr);
+		return 1;
+	}
+
 	WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
 		(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: rockchip: handle zero length transfers without timing out
  2021-08-27  5:03 [PATCH] spi: rockchip: handle zero length transfers without timing out Tobias Schramm
@ 2021-09-03 15:18 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-09-03 15:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-rockchip, Tobias Schramm,
	linux-spi
  Cc: Mark Brown, Heiko Stuebner

On Fri, 27 Aug 2021 07:03:57 +0200, Tobias Schramm wrote:
> Previously zero length transfers submitted to the Rokchip SPI driver would
> time out in the SPI layer. This happens because the SPI peripheral does
> not trigger a transfer completion interrupt for zero length transfers.
> 
> Fix that by completing zero length transfers immediately at start of
> transfer.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: rockchip: handle zero length transfers without timing out
      commit: 5457773ef99f25fcc4b238ac76b68e28273250f4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-03 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27  5:03 [PATCH] spi: rockchip: handle zero length transfers without timing out Tobias Schramm
2021-09-03 15:18 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).