Skip to content

Commit 577f1cf

Browse files
Jon Linbroonie
authored andcommitted
spi: rockchip-sfc: Optimize the judgment mechanism completed by the controller
There is very little data left in fifo, and the controller will complete the transmission in a short period of time, so use readl_poll_timeout() for busy wait 10us to accelerate response. Signed-off-by: Jon Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ba257e7 commit 577f1cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/spi/spi-rockchip-sfc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,16 @@ static int rockchip_sfc_xfer_done(struct rockchip_sfc *sfc, u32 timeout_us)
472472
int ret = 0;
473473
u32 status;
474474

475+
/*
476+
* There is very little data left in fifo, and the controller will
477+
* complete the transmission in a short period of time.
478+
*/
479+
ret = readl_poll_timeout(sfc->regbase + SFC_SR, status,
480+
!(status & SFC_SR_IS_BUSY),
481+
0, 10);
482+
if (!ret)
483+
return 0;
484+
475485
ret = readl_poll_timeout(sfc->regbase + SFC_SR, status,
476486
!(status & SFC_SR_IS_BUSY),
477487
20, timeout_us);

0 commit comments

Comments
 (0)