* [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
@ 2026-10-23 19:15 Carl Smith
2026-10-23 19:38 ` sashiko-bot
2026-10-26 22:12 ` Guenter Roeck
0 siblings, 2 replies; 4+ 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 related [flat|nested] 4+ 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
@ 2026-10-23 19:38 ` sashiko-bot
2026-10-25 18:55 ` Carl Smith
2026-10-26 22:12 ` Guenter Roeck
1 sibling, 1 reply; 4+ messages in thread
From: sashiko-bot @ 2026-10-23 19:38 UTC (permalink / raw)
To: Carl Smith; +Cc: linux-watchdog
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] watchdog: octeon-wdt: undocumented panic_on_timeout module parameter
--
commit 3f30c4c06ea7c605e88ff05165b08aa4592f832c
Author: Carl Smith <carl.smith@alliedtelesis.co.nz>
watchdog: octeon-wdt: Add a panic_on_timeout parameter
This commit adds a panic_on_timeout module parameter to the octeon-wdt driver
so that a kernel panic can be triggered when the software heartbeat expires,
allowing crash loggers such as mtdoops to record the event before the
hardware watchdog resets the board.
> diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c
> index 171b46d780e6f..d29a638998475 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)");
[Severity: Low]
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)?
Because panic_on_timeout is registered with module_param() with mode 0444 and
CONFIG_OCTEON_WDT defaults to built-in on CAVIUM_OCTEON_SOC, passing
octeon_wdt.panic_on_timeout on the kernel command line is the primary way to
enable it when built-in, and kernel parameters exposed via module_param() are
expected to be documented in Documentation/admin-guide/kernel-parameters.txt.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261023191530.327734-1-carl.smith@alliedtelesis.co.nz?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
2026-10-23 19:38 ` sashiko-bot
@ 2026-10-25 18:55 ` Carl Smith
0 siblings, 0 replies; 4+ messages in thread
From: Carl Smith @ 2026-10-25 18:55 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
sashiko-reviews@lists.linux.dev
> 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] 4+ 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
2026-10-23 19:38 ` sashiko-bot
@ 2026-10-26 22:12 ` Guenter Roeck
1 sibling, 0 replies; 4+ 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] 4+ messages in thread
end of thread, other threads:[~2026-10-26 22:12 UTC | newest]
Thread overview: 4+ 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
2026-10-23 19:38 ` sashiko-bot
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