mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
UPSTREAM: 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: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5457773ef9)
Change-Id: I0c14eee10fbf0ffd2938d52b6d0c88910d8fd9d7
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
This commit is contained in:
@@ -684,6 +684,12 @@ static int rockchip_spi_transfer_one(
|
||||
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
|
||||
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