[PATCH] watchdog: orion_wdt: stop the watchdog during system suspend
From: Igor Velkov via B4 Relay
Date: Sun Oct 11 2026 - 19:17:13 EST
From: Igor Velkov <iav@xxxxxx>
The watchdog timer keeps counting across system suspend while the
userspace that pings it is frozen, so it expires and resets the system.
On a Kobol Helios4 (Armada 388) with a 60 s timeout the board resets
47-61 s into s2idle, whether the watchdog daemon or systemd's
RuntimeWatchdogSec holds the device.
Stop the timer on suspend and restart it on resume when it is active or
running in hardware, as sp805_wdt does. orion_wdt_start() reloads the
counter, so userspace gets a full timeout after resume.
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@xxxxxx>
---
Tested on a Kobol Helios4 (Armada 388, v7.2.9). Unpatched, the board
resets 60 s into s2idle. With this patch:
- watchdog daemon: three 120 s s2idle cycles, no reset;
- systemd RuntimeWatchdogSec=60s: one 120 s s2idle and one 120 s
standby cycle, no reset;
- the watchdog still fires after resume: freezing the daemon (SIGSTOP)
after the s2idle cycles reset the board in 61 s, a panic after
standby in 54 s.
---
drivers/watchdog/orion_wdt.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 5d56e93f0406..0e3d896fe930 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -668,6 +668,29 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
orion_wdt_stop(wdt_dev);
}
+static int orion_wdt_suspend(struct device *dev)
+{
+ struct watchdog_device *wdt_dev = dev_get_drvdata(dev);
+
+ if (watchdog_active(wdt_dev) || watchdog_hw_running(wdt_dev))
+ return orion_wdt_stop(wdt_dev);
+
+ return 0;
+}
+
+static int orion_wdt_resume(struct device *dev)
+{
+ struct watchdog_device *wdt_dev = dev_get_drvdata(dev);
+
+ if (watchdog_active(wdt_dev) || watchdog_hw_running(wdt_dev))
+ return orion_wdt_start(wdt_dev);
+
+ return 0;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(orion_wdt_pm_ops, orion_wdt_suspend,
+ orion_wdt_resume);
+
static struct platform_driver orion_wdt_driver = {
.probe = orion_wdt_probe,
.remove = orion_wdt_remove,
@@ -675,6 +698,7 @@ static struct platform_driver orion_wdt_driver = {
.driver = {
.name = "orion_wdt",
.of_match_table = orion_wdt_of_match_table,
+ .pm = pm_sleep_ptr(&orion_wdt_pm_ops),
},
};
---
base-commit: 8b5a9f09037e3c372c4e9f2fbda85fcfbf5ea5f0
change-id: 20261012-orion-wdt-suspend-08f276aafa14
Best regards,
--
Igor Velkov <iav@xxxxxx>