public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.10 01/23] spi: rockchip: handle zero length transfers without timing out
@ 2021-09-28  5:56 Sasha Levin
  2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 02/23] platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet Sasha Levin
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: Sasha Levin @ 2021-09-28  5:56 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Tobias Schramm, Mark Brown, Sasha Levin, heiko, linux-spi,
	linux-arm-kernel, linux-rockchip

From: Tobias Schramm <t.schramm@manjaro.org>

[ Upstream commit 5457773ef99f25fcc4b238ac76b68e28273250f4 ]

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>
Link: https://lore.kernel.org/r/20210827050357.165409-1-t.schramm@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.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 0aab37cd64e7..624273d0e727 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -582,6 +582,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] 23+ messages in thread

end of thread, other threads:[~2021-09-28  6:00 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28  5:56 [PATCH AUTOSEL 5.10 01/23] spi: rockchip: handle zero length transfers without timing out Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 02/23] platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 03/23] platform/x86: touchscreen_dmi: Update info for the Chuwi Hi10 Plus (CWI527) tablet Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 04/23] nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 05/23] btrfs: replace BUG_ON() in btrfs_csum_one_bio() with proper error handling Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 06/23] btrfs: fix mount failure due to past and transient device flush error Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 07/23] net: mdio: introduce a shutdown method to mdio device drivers Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 08/23] xen-netback: correct success/error reporting for the SKB-with-fraglist case Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 09/23] sparc64: fix pci_iounmap() when CONFIG_PCI is not set Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 10/23] ext2: fix sleeping in atomic bugs on error Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 11/23] scsi: sd: Free scsi_disk device via put_device() Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 12/23] usb: testusb: Fix for showing the connection speed Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 13/23] usb: dwc2: check return value after calling platform_get_resource() Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 14/23] habanalabs/gaudi: fix LBW RR configuration Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 15/23] selftests: be sure to make khdr before other targets Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 16/23] selftests:kvm: fix get_warnings_count() ignoring fscanf() return warn Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 17/23] nvme-fc: update hardware queues before using them Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 18/23] nvme-fc: avoid race between time out and tear down Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 19/23] thermal/drivers/tsens: Fix wrong check for tzd in irq handlers Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 20/23] scsi: ses: Retry failed Send/Receive Diagnostic commands Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 21/23] irqchip/gic: Work around broken Renesas integration Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 22/23] smb3: correct smb3 ACL security descriptor Sasha Levin
2021-09-28  5:56 ` [PATCH AUTOSEL 5.10 23/23] tools/vm/page-types: remove dependency on opt_file for idle page tracking Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox