diff options
author | 2024-12-03 09:35:13 +0800 | |
---|---|---|
committer | 2024-12-04 13:44:17 +0000 | |
commit | 577f1cf76ceedb5fbdc9aca4f712b21864ac15ee (patch) | |
tree | b972bb3fbf46fe3b7e31f045d8e9383151268813 | |
parent | spi: cadence-quadspi: Add support for device reset (diff) | |
download | wireguard-linux-577f1cf76ceedb5fbdc9aca4f712b21864ac15ee.tar.xz wireguard-linux-577f1cf76ceedb5fbdc9aca4f712b21864ac15ee.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/spi/spi-rockchip-sfc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index 138508d2c736..14f5b9346050 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -472,6 +472,16 @@ static int rockchip_sfc_xfer_done(struct rockchip_sfc *sfc, u32 timeout_us) int ret = 0; 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, !(status & SFC_SR_IS_BUSY), 20, timeout_us); |