* [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
@ 2026-10-23 19:15 Carl Smith
[not found] ` <sashiko-outbox-183127@kernel.org>
2026-10-26 22:12 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Carl Smith @ 2026-10-23 19:15 UTC (permalink / raw)
To: wim, linux; +Cc: linux-watchdog, linux-kernel, Carl Smith
The hardware watchdog period is only a few seconds, so the driver counts
the heartbeat in software and stops poking the hardware when it expires.
The resulting reset leaves no record for crash loggers such as mtdoops.
Add a panic_on_timeout module parameter, off by default like softdog's
soft_panic, that panics when the heartbeat expires. The panic is logged,
and the hardware watchdog still resets the board.
Tested on a CN7130 board with mtdoops.
Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
---
Note: octeon-wdt doesn't support pretimeouts, so the panic pretimeout governor
can't be used.
drivers/watchdog/octeon-wdt-main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c
index 171b46d780e6..d29a63899847 100644
--- a/drivers/watchdog/octeon-wdt-main.c
+++ b/drivers/watchdog/octeon-wdt-main.c
@@ -107,6 +107,11 @@ module_param(disable, int, 0444);
MODULE_PARM_DESC(disable,
"Disable the watchdog entirely (default=0)");
+static bool panic_on_timeout;
+module_param(panic_on_timeout, bool, 0444);
+MODULE_PARM_DESC(panic_on_timeout,
+ "Panic when the heartbeat expires, instead of a silent reset (default=0)");
+
static struct cvmx_boot_vector_element *octeon_wdt_bootvector;
void octeon_wdt_nmi_stage2(void);
@@ -143,6 +148,8 @@ static irqreturn_t octeon_wdt_poke_irq(int cpl, void *dev_id)
/* Bad news, you are about to reboot. */
disable_irq_nosync(cpl);
cpumask_clear_cpu(cpu, &irq_enabled_cpus);
+ if (panic_on_timeout)
+ panic("Watchdog timeout");
}
} else {
/* Not open, just ping away... */
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
[not found] ` <sashiko-outbox-183127@kernel.org>
@ 2026-10-25 18:55 ` Carl Smith
0 siblings, 0 replies; 3+ messages in thread
From: Carl Smith @ 2026-10-25 18:55 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: linux-watchdog, linux-kernel, sashiko-reviews
> Should the new panic_on_timeout parameter in drivers/watchdog/octeon-wdt-main.c
> also be documented in Documentation/admin-guide/kernel-parameters.txt (and
> Documentation/watchdog/watchdog-parameters.rst)?
kernel-parameters.txt does not list per-driver watchdog parameters; none
of the watchdog drivers have entries there, including softdog's
soft_panic.
watchdog-parameters.rst has no section for octeon-wdt at all, so its
existing heartbeat, nowayout and disable parameters are not documented
either. I can add an octeon_wdt section there covering all four
parameters, either in a v2 of this patch or as a separate patch,
whichever you prefer.
Carl
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
2026-10-23 19:15 [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter Carl Smith
[not found] ` <sashiko-outbox-183127@kernel.org>
@ 2026-10-26 22:12 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-10-26 22:12 UTC (permalink / raw)
To: Carl Smith; +Cc: wim, linux-watchdog, linux-kernel
On Sat, Oct 24, 2026 at 08:15:30AM +1300, Carl Smith wrote:
> The hardware watchdog period is only a few seconds, so the driver counts
> the heartbeat in software and stops poking the hardware when it expires.
> The resulting reset leaves no record for crash loggers such as mtdoops.
>
> Add a panic_on_timeout module parameter, off by default like softdog's
> soft_panic, that panics when the heartbeat expires. The panic is logged,
> and the hardware watchdog still resets the board.
>
> Tested on a CN7130 board with mtdoops.
>
> Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-26 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 19:15 [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter Carl Smith
[not found] ` <sashiko-outbox-183127@kernel.org>
2026-10-25 18:55 ` Carl Smith
2026-10-26 22:12 ` 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®