You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
spi: rockchip: handle zero length transfers without timing out
[ Upstream commit 5457773ef9 ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5cd40b137c
commit
2ababcd8c2
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user