All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-watchdog@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>, Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH] watchdog: dw_wdt: Stop ping worker on system suspend
Date: Sun,  8 Nov 2026 15:33:29 -0800	[thread overview]
Message-ID: <20261108233329.1059273-1-linux@roeck-us.net> (raw)

When the Synopsys DesignWare watchdog is active with the watchdog core
heartbeat worker running (such as when WDOG_HW_RUNNING is set at boot,
when the watchdog is left running after /dev/watchdog is closed, or when
configured with a timeout exceeding wdd->max_hw_heartbeat_ms), the
watchdog core arms its hrtimer so the non-freezable watchdogd kthread
worker periodically pings the hardware.

Because dw_wdt_drv_probe() does not call watchdog_stop_ping_on_suspend(),
WDOG_NO_PING_ON_SUSPEND is not set and the watchdog core leaves its
hrtimer and ping work active across system suspend. After
dw_wdt_suspend() asserts dw_wdt->rst and disables dw_wdt->pclk and
dw_wdt->clk, an expiring timer queues watchdog_ping_work(), invoking
dw_wdt_ping() to write WDOG_COUNTER_RESTART_REG_OFFSET while the
controller is unclocked and in reset. This may trigger a synchronous
external abort, bus error, or system hang.

This did not matter and actually worked as expected since the watchdog
can not be stopped directly. However, commit 1bfe88893808 ("watchdog:
dw_wdt: add stop watchdog operation") implemented stop functionality by
resetting the watchdog core, and commit 0b0ff67cbc2aa ("watchdog: dw_wdt:
manage reset line during system suspend/resume") puts the watchdog hardware
into reset during suspend, causing the potential problem described above.

Call watchdog_stop_ping_on_suspend() in dw_wdt_drv_probe() so the
watchdog core cancels its ping timer and work in PM_SUSPEND_PREPARE
before clocks are gated and resumes pinging in PM_POST_SUSPEND after
clocks and reset are restored.

Fixes: f29a72c24ad4 ("watchdog: dw_wdt: Convert to use watchdog infrastructure")
Fixes: 1bfe88893808 ("watchdog: dw_wdt: add stop watchdog operation")
Fixes: 0b0ff67cbc2aa ("watchdog: dw_wdt: manage reset line during system suspend/resume")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/bug/linux-4cde70aa-2cd0-405d-a626-7b41bfe6bbb7
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/dw_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index c1d40d7b2165..7c1c2378f475 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -653,6 +653,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
 
 	watchdog_set_restart_priority(wdd, 128);
 	watchdog_stop_on_reboot(wdd);
+	watchdog_stop_ping_on_suspend(wdd);
 
 	ret = watchdog_register_device(wdd);
 	if (ret)
-- 
2.45.2


             reply	other threads:[~2026-11-08 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 23:33 Guenter Roeck [this message]
2026-11-08 23:40 ` [PATCH] watchdog: dw_wdt: Stop ping worker on system suspend sashiko-bot

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=20261108233329.1059273-1-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=sashiko-bot@kernel.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 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.