All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: sp805_wdt: re-enable the clock in the restart handler
@ 2026-11-20 20:10 David Yang
  2026-11-20 20:19 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: David Yang @ 2026-11-20 20:10 UTC (permalink / raw)
  To: linux-watchdog; +Cc: David Yang, Wim Van Sebroeck, Guenter Roeck, linux-kernel

wdt_restart() fail to reboot the system if the watchdog counter clock
was previously disabled: If userspace cleanly stops the watchdog, the
core calls wdt_disable() which disables wdt->clk. No reset comes.

Re-enable the clock in it as in npcm_wdt.

Link: https://lore.kernel.org/r/20260911031916.A8E051F000FF@smtp.kernel.org
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
 drivers/watchdog/sp805_wdt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index a14ff7ac0db4..20b2fbb7334d 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -138,6 +138,9 @@ wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd)
 {
 	struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
 
+	/* For reset, we start the WDT clock and leave it running. */
+	clk_prepare_enable(wdt->clk);
+
 	writel_relaxed(UNLOCK, wdt->base + WDTLOCK);
 	writel_relaxed(0, wdt->base + WDTCONTROL);
 	writel_relaxed(0, wdt->base + WDTLOAD);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 20:10 [PATCH] watchdog: sp805_wdt: re-enable the clock in the restart handler David Yang
2026-11-20 20:19 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.