Skip to content

Commit 5457773

Browse files
TobleMinerbroonie
authored andcommitted
spi: rockchip: handle zero length transfers without timing out
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 26cfc0d commit 5457773

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi-rockchip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ static int rockchip_spi_transfer_one(
600600
int ret;
601601
bool use_dma;
602602

603+
/* Zero length transfers won't trigger an interrupt on completion */
604+
if (!xfer->len) {
605+
spi_finalize_current_transfer(ctlr);
606+
return 1;
607+
}
608+
603609
WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
604610
(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
605611

0 commit comments

Comments
 (0)