* [PATCH v2 0/2] watchdog: orion_wdt: stop the watchdog during system suspend
@ 2026-10-12 0:46 Igor Velkov via B4 Relay
2026-10-12 0:46 ` [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start Igor Velkov via B4 Relay
2026-10-12 0:46 ` [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
0 siblings, 2 replies; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-10-12 0:46 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: Chris Packham, Gregory CLEMENT, linux-watchdog, linux-arm-kernel,
linux-kernel, Igor Velkov
The watchdog keeps counting across system suspend while the userspace
that pings it is frozen, so a Kobol Helios4 (Armada 388) resets 60 s
into s2idle. Patch 2 stops the timer on suspend and restarts it on
resume. Patch 1 fixes the Armada XP pretimeout that Sashiko spotted on
the restart path of v1; the same bug hits every start since
7a6b3d8a432d.
Tested on a Helios4 (v7.2.9). Unpatched, the board resets 60 s into
s2idle. With patch 2:
- 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.
Patch 1 is compile-tested only; I have no Armada XP.
Signed-off-by: Igor Velkov <iav@iav.lv>
---
Changes in v2:
- Add patch 1, the Armada XP pretimeout reload (Sashiko).
- Keep pm_sleep_ptr(): it is the pairing for DEFINE_SIMPLE_DEV_PM_OPS()
(1a3c7bb08826).
- Link to v1: https://lore.kernel.org/r/20261012-orion-wdt-suspend-v1-1-1676cb79e29e@iav.lv
---
Igor Velkov (2):
watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start
watchdog: orion_wdt: stop the watchdog during system suspend
drivers/watchdog/orion_wdt.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
---
base-commit: 8b5a9f09037e3c372c4e9f2fbda85fcfbf5ea5f0
change-id: 20261012-orion-wdt-suspend-08f276aafa14
Best regards,
--
Igor Velkov <iav@iav.lv>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start
2026-10-12 0:46 [PATCH v2 0/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
@ 2026-10-12 0:46 ` Igor Velkov via B4 Relay
2026-10-20 1:33 ` Guenter Roeck
2026-10-12 0:46 ` [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
1 sibling, 1 reply; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-10-12 0:46 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: Chris Packham, Gregory CLEMENT, linux-watchdog, linux-arm-kernel,
linux-kernel, Igor Velkov
From: Igor Velkov <iav@iav.lv>
armada370_start() enables TIMER1 for the pretimeout but, unlike
armada375_start(), does not load its counter, so TIMER1 runs down from
whatever value it holds and the pretimeout can fire early. Of the boards
that use armada370_start(), only Armada XP and 98DX3236 describe the
pretimeout interrupt in their device tree.
Load TIMER1 on start the same way armada375_start() does.
Fixes: 7a6b3d8a432d ("watchdog: orion_wdt: support pretimeout on Armada-XP")
Link: https://sashiko.dev/#/patchset/20261012-orion-wdt-suspend-v1-1-1676cb79e29e@iav.lv?part=1
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@iav.lv>
---
drivers/watchdog/orion_wdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 5d56e93f0406..ef64e3730001 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -232,6 +232,9 @@ static int armada370_start(struct watchdog_device *wdt_dev)
/* Set watchdog duration */
writel(dev->clk_rate * wdt_dev->timeout,
dev->reg + dev->data->wdt_counter_offset);
+ if (dev->wdt.info->options & WDIOF_PRETIMEOUT)
+ writel(dev->clk_rate * (wdt_dev->timeout - wdt_dev->pretimeout),
+ dev->reg + TIMER1_VAL_OFF);
/* Clear the watchdog expiration bit */
atomic_io_modify(dev->reg + TIMER_A370_STATUS, WDT_A370_EXPIRED, 0);
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start
2026-10-12 0:46 ` [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start Igor Velkov via B4 Relay
@ 2026-10-20 1:33 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-10-20 1:33 UTC (permalink / raw)
To: Igor Velkov
Cc: Wim Van Sebroeck, Chris Packham, Gregory CLEMENT, linux-watchdog,
linux-arm-kernel, linux-kernel
On Mon, Oct 12, 2026 at 03:46:56AM +0300, Igor Velkov wrote:
> From: Igor Velkov <iav@iav.lv>
>
> armada370_start() enables TIMER1 for the pretimeout but, unlike
> armada375_start(), does not load its counter, so TIMER1 runs down from
> whatever value it holds and the pretimeout can fire early. Of the boards
> that use armada370_start(), only Armada XP and 98DX3236 describe the
> pretimeout interrupt in their device tree.
>
> Load TIMER1 on start the same way armada375_start() does.
>
> Fixes: 7a6b3d8a432d ("watchdog: orion_wdt: support pretimeout on Armada-XP")
> Link: https://sashiko.dev/#/patchset/20261012-orion-wdt-suspend-v1-1-1676cb79e29e@iav.lv?part=1
> Assisted-by: LLM
> Signed-off-by: Igor Velkov <iav@iav.lv>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend
2026-10-12 0:46 [PATCH v2 0/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
2026-10-12 0:46 ` [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start Igor Velkov via B4 Relay
@ 2026-10-12 0:46 ` Igor Velkov via B4 Relay
2026-10-20 1:34 ` Guenter Roeck
1 sibling, 1 reply; 5+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-10-12 0:46 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: Chris Packham, Gregory CLEMENT, linux-watchdog, linux-arm-kernel,
linux-kernel, Igor Velkov
From: Igor Velkov <iav@iav.lv>
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@iav.lv>
---
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 ef64e3730001..c65042dc2329 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -671,6 +671,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,
@@ -678,6 +701,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),
},
};
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend
2026-10-12 0:46 ` [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
@ 2026-10-20 1:34 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-10-20 1:34 UTC (permalink / raw)
To: Igor Velkov
Cc: Wim Van Sebroeck, Chris Packham, Gregory CLEMENT, linux-watchdog,
linux-arm-kernel, linux-kernel
On Mon, Oct 12, 2026 at 03:46:57AM +0300, Igor Velkov wrote:
> From: Igor Velkov <iav@iav.lv>
>
> 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@iav.lv>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-20 1:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12 0:46 [PATCH v2 0/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
2026-10-12 0:46 ` [PATCH v2 1/2] watchdog: orion_wdt: load the pretimeout counter on Armada 370/XP start Igor Velkov via B4 Relay
2026-10-20 1:33 ` Guenter Roeck
2026-10-12 0:46 ` [PATCH v2 2/2] watchdog: orion_wdt: stop the watchdog during system suspend Igor Velkov via B4 Relay
2026-10-20 1:34 ` Guenter Roeck
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®