[PATCH] watchdog: octeon-wdt: Add a panic_on_timeout parameter
From: Carl Smith
Date: Fri Oct 23 2026 - 15:18:31 EST
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@xxxxxxxxxxxxxxxxxxx>
---
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