[PATCH] watchdog: rti_wdt: return 0 even when not ready for ping

Sascha Hauer s.hauer at pengutronix.de
Mon Mar 17 03:40:22 PDT 2025


The rti_wdt is a windowed watchdog which means we are not allowed to
ping the watchdog outside a certain timing window. When pinging the
watchdog too early the watchdog will trigger.

We used to return -EBUSY from the watchdogs ping callback when
pinging outside the timing window. We may ping the watchdog multiple
times in boot_entry() which then results in

Failed to enable watchdog: Device or resource busy

Avoid these messages by returning successfully even when pinged too
early.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/watchdog/rti_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index f5ca6683db..ffc4427059 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -56,7 +56,7 @@ static int rti_wdt_ping(struct watchdog *wdt)
 	halftime = wdt->timeout_cur / 2 + 1;
 
 	if (!is_timeout_non_interruptible(wdt->last_ping, halftime * SECOND))
-		return -EBUSY;
+		return 0;
 
 	writel(WDKEY_SEQ0, priv->regs + RTIWDKEY);
 	writel(WDKEY_SEQ1, priv->regs + RTIWDKEY);
-- 
2.39.5




More information about the barebox mailing list