[PATCH v4 3/3] watchdog: pretimeout: update PSC reason in panic pretimeout governor

Faruque Ansari <[email protected]>
Newsgroups org.kernel.vger.linux-watchdog,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm
Message-ID <[email protected]>
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 <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.