mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
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 <jon.lin@rock-chips.com> Link: https://patch.msgid.link/20241203013513.2628810-1-jon.lin@rock-chips.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ba257e7006
commit
577f1cf76c
1 changed files with 10 additions and 0 deletions
|
|
@ -472,6 +472,16 @@ static int rockchip_sfc_xfer_done(struct rockchip_sfc *sfc, u32 timeout_us)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u32 status;
|
u32 status;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There is very little data left in fifo, and the controller will
|
||||||
|
* complete the transmission in a short period of time.
|
||||||
|
*/
|
||||||
|
ret = readl_poll_timeout(sfc->regbase + SFC_SR, status,
|
||||||
|
!(status & SFC_SR_IS_BUSY),
|
||||||
|
0, 10);
|
||||||
|
if (!ret)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ret = readl_poll_timeout(sfc->regbase + SFC_SR, status,
|
ret = readl_poll_timeout(sfc->regbase + SFC_SR, status,
|
||||||
!(status & SFC_SR_IS_BUSY),
|
!(status & SFC_SR_IS_BUSY),
|
||||||
20, timeout_us);
|
20, timeout_us);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue