From: Guenter Roeck <linux@roeck-us.net>
To: David Yang <mmyangfl@gmail.com>, linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: sp805_wdt: re-enable the clock in the restart handler
Date: Fri, 20 Nov 2026 15:13:35 -0800 [thread overview]
Message-ID: <8710a71f-a2fe-4dd4-83b1-8ca2cca00985@roeck-us.net> (raw)
In-Reply-To: <20261120201029.1685193-1-mmyangfl@gmail.com>
On 11/20/26 12:10, David Yang wrote:
> 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);
This probably needs a fix similar to commit 4e83ea5b2219 ("watchdog: npcm:
fix sleeping clock call in restart handler") - leave the clock prepared
all the time and only enable / disable it when starting or stopping the
watchdog.
Guenter
prev parent reply other threads:[~2026-11-20 23:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 20:10 David Yang
2026-11-20 23:13 ` Guenter Roeck [this message]
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=8710a71f-a2fe-4dd4-83b1-8ca2cca00985@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=mmyangfl@gmail.com \
--cc=wim@linux-watchdog.org \
/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
all inboxes | Powered by JetHome®