[PATCH 2/2] watchdog: fix watchdog restart handler when autoping is enabled
Sascha Hauer
s.hauer at pengutronix.de
Mon May 27 02:50:57 PDT 2024
When the watchdog autoping feature is enabled it will ping the watchdog
every 0.5s. This becomes a problem when the fallback restart handler is
called to reset the CPU. It will then set the watchdog to trigger in one
second and waits for CPU reset using mdelay(). During the mdelay() the
autoping poller will continue to feed the watchdog, so we never actually
reset the CPU.
Use mdelay_non_interruptible() instead so that no poller can run in the
background.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/watchdog/wd_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/wd_core.c b/drivers/watchdog/wd_core.c
index f39a8f4522..42cbd7b72c 100644
--- a/drivers/watchdog/wd_core.c
+++ b/drivers/watchdog/wd_core.c
@@ -178,7 +178,8 @@ static void __noreturn watchdog_restart_handle(struct restart_handler *this)
ret = watchdog_set_timeout(wd, 1);
BUG_ON(ret);
- mdelay(2000);
+
+ mdelay_non_interruptible(2000);
pr_emerg("Watchdog failed to reset the machine\n");
hang();
--
2.39.2
More information about the barebox
mailing list