* [PATCH] drivers: cadence_qspi_apb: Add watchdog_reset to prevent timeout
@ 2022-09-18 13:19 Jit Loon Lim
0 siblings, 0 replies; only message in thread
From: Jit Loon Lim @ 2022-09-18 13:19 UTC (permalink / raw)
To: u-boot
Cc: Jagan Teki, Vignesh R, Marek, Simon, Tien Fong, Kok Kiang,
Siew Chin, Sin Hui, Raaj, Dinesh, Boon Khai, Alif, Teik Heng,
Hazim, Jit Loon Lim, Sieu Mun Tang, Yau Wai Gan
From: Yau Wai Gan <yau.wai.gan@.intel.com>
Reset the watchdog within functions that require long processing
time to prevent watchdog timeout.
Signed-off-by: Yau Wai Gan <yau.wai.gan@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
drivers/spi/cadence_qspi_apb.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
index c00755050e..e7e0bb649f 100644
--- a/drivers/spi/cadence_qspi_apb.c
+++ b/drivers/spi/cadence_qspi_apb.c
@@ -149,6 +149,7 @@ static unsigned int cadence_qspi_wait_idle(void *reg_base)
start = get_timer(0);
for ( ; get_timer(start) < timeout ; ) {
+ WATCHDOG_RESET();
if (CQSPI_REG_IS_IDLE(reg_base))
count++;
else
@@ -356,6 +357,7 @@ int cadence_qspi_apb_exec_flash_cmd(void *reg_base, unsigned int reg)
if ((reg & CQSPI_REG_CMDCTRL_INPROGRESS) == 0)
break;
udelay(1);
+ WATCHDOG_RESET();
}
if (!retry) {
@@ -652,6 +654,7 @@ static int cadence_qspi_wait_for_data(struct cadence_spi_plat *plat)
if (reg)
return reg;
udelay(1);
+ WATCHDOG_RESET();
}
return -ETIMEDOUT;
@@ -696,6 +699,7 @@ cadence_qspi_apb_indirect_read_execute(struct cadence_spi_plat *plat,
rxbuf += bytes_to_read;
remaining -= bytes_to_read;
bytes_to_read = cadence_qspi_get_rd_sram_level(plat);
+ WATCHDOG_RESET();
}
}
@@ -863,6 +867,7 @@ cadence_qspi_apb_indirect_write_execute(struct cadence_spi_plat *plat,
bb_txbuf += write_bytes;
remaining -= write_bytes;
+ WATCHDOG_RESET();
}
/* Check indirect done status */
--
2.26.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-18 13:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-18 13:19 [PATCH] drivers: cadence_qspi_apb: Add watchdog_reset to prevent timeout Jit Loon Lim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox