Linux Watchdog driver development
 help / color / mirror / Atom feed
* [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

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