diff mbox series

[v3] spi: nxp-fspi: Use new readl_poll_sleep_timeout API

Message ID 1587971331-22029-1-git-send-email-kuldeep.singh@nxp.com
State Accepted
Commit 28029c768c4761d10815f94cafbbdc86272f1d8d
Headers show
Series [v3] spi: nxp-fspi: Use new readl_poll_sleep_timeout API | expand

Commit Message

Kuldeep Singh April 27, 2020, 7:08 a.m. UTC
Board gets reset when performing burst read/write operations. On the
other hand, no such behaviour is observed on small size operations.

In Linux, readl_poll_timeout API already adds delay of 1us which is
further skipped in U-boot. Hence, use new "readl_poll_sleep_timeout" API
which adds delay alongwith timeout functionality.

Signed-off-by: Kuldeep Singh <kuldeep.singh at nxp.com>
---
v3:
-Reword commit message and use new API instead of adding delay.
-Depends on:
a) https://patchwork.ozlabs.org/project/uboot/patch/20200425110354.12381-2-jagan at amarulasolutions.com/
b) https://patchwork.ozlabs.org/project/uboot/patch/20200425110354.12381-3-jagan at amarulasolutions.com/

v2:
-Add comments above udelay(1) change.

 drivers/spi/nxp_fspi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c
index 0e6c7be..22a5c0e 100644
--- a/drivers/spi/nxp_fspi.c
+++ b/drivers/spi/nxp_fspi.c
@@ -421,7 +421,7 @@  static bool nxp_fspi_supports_op(struct spi_slave *slave,
 	return true;
 }
 
-/* Instead of busy looping invoke readl_poll_timeout functionality. */
+/* Instead of busy looping invoke readl_poll_sleep_timeout functionality. */
 static int fspi_readl_poll_tout(struct nxp_fspi *f, void __iomem *base,
 				u32 mask, u32 delay_us,
 				u32 timeout_us, bool c)
@@ -432,11 +432,11 @@  static int fspi_readl_poll_tout(struct nxp_fspi *f, void __iomem *base,
 		mask = (u32)cpu_to_be32(mask);
 
 	if (c)
-		return readl_poll_timeout(base, reg, (reg & mask),
-					  timeout_us);
+		return readl_poll_sleep_timeout(base, reg, (reg & mask),
+						delay_us, timeout_us);
 	else
-		return readl_poll_timeout(base, reg, !(reg & mask),
-					  timeout_us);
+		return readl_poll_sleep_timeout(base, reg, !(reg & mask),
+						delay_us, timeout_us);
 }
 
 /*