[PATCH v4 3/3] watchdog: pretimeout: update PSC reason in panic pretimeout governor
From: Faruque Ansari
Date: Wed Aug 05 2026 - 04:56:51 EST
Update the PSC reset reason by invoking
set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT) from the panic governor's
pretimeout handler before calling panic(), so the reset cause is
committed to persistent storage before the system goes down.
Signed-off-by: Faruque Ansari <faruque.ansari@xxxxxxxxxxxxxxxx>
Acked-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
drivers/watchdog/pretimeout_panic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/pretimeout_panic.c b/drivers/watchdog/pretimeout_panic.c
index 8c3ac674dc45..819487b5e6fe 100644
--- a/drivers/watchdog/pretimeout_panic.c
+++ b/drivers/watchdog/pretimeout_panic.c
@@ -5,6 +5,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/reboot.h>
#include <linux/watchdog.h>
#include "watchdog_pretimeout.h"
@@ -17,6 +18,7 @@
*/
static void pretimeout_panic(struct watchdog_device *wdd)
{
+ set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT);
panic("watchdog pretimeout event\n");
}
--
2.34.1