public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jit Loon Lim <jit.loon.lim@intel.com>
To: u-boot@lists.denx.de
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	Vignesh R <vigneshr@ti.com>, Marek <marex@denx.de>,
	Simon <simon.k.r.goldschmidt@gmail.com>,
	Tien Fong <tien.fong.chee@intel.com>,
	Kok Kiang <kok.kiang.hea@intel.com>,
	Siew Chin <elly.siew.chin.lim@intel.com>,
	Sin Hui <sin.hui.kho@intel.com>, Raaj <raaj.lokanathan@intel.com>,
	Dinesh <dinesh.maniyam@intel.com>,
	Boon Khai <boon.khai.ng@intel.com>,
	Alif <alif.zakuan.yuslaimi@intel.com>,
	Teik Heng <teik.heng.chong@intel.com>,
	Hazim <muhammad.hazim.izzat.zamri@intel.com>,
	Jit Loon Lim <jit.loon.lim@intel.com>,
	Sieu Mun Tang <sieu.mun.tang@intel.com>,
	Yau Wai Gan <yau.wai.gan@intel.com>
Subject: [PATCH] drivers: cadence_qspi_apb: Add watchdog_reset to prevent timeout
Date: Sun, 18 Sep 2022 21:19:56 +0800	[thread overview]
Message-ID: <20220918132012.14509-1-jit.loon.lim@intel.com> (raw)

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


                 reply	other threads:[~2022-09-18 13:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220918132012.14509-1-jit.loon.lim@intel.com \
    --to=jit.loon.lim@intel.com \
    --cc=alif.zakuan.yuslaimi@intel.com \
    --cc=boon.khai.ng@intel.com \
    --cc=dinesh.maniyam@intel.com \
    --cc=elly.siew.chin.lim@intel.com \
    --cc=jagan@amarulasolutions.com \
    --cc=kok.kiang.hea@intel.com \
    --cc=marex@denx.de \
    --cc=muhammad.hazim.izzat.zamri@intel.com \
    --cc=raaj.lokanathan@intel.com \
    --cc=sieu.mun.tang@intel.com \
    --cc=simon.k.r.goldschmidt@gmail.com \
    --cc=sin.hui.kho@intel.com \
    --cc=teik.heng.chong@intel.com \
    --cc=tien.fong.chee@intel.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    --cc=yau.wai.gan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox