[PATCH v4 0/3] power: reset: pscrr: record reset cause on panic and watchdog pretimeout
Faruque Ansari <[email protected]> Wed, 05 Aug 2026 14:24:54 +0530
| Newsgroups | org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm,org.kernel.vger.linux-watchdog |
|---|---|
| Message-ID | <[email protected]> |
This series extends the Power State Change Reason Register (PSCRR) [1]
framework to capture two additional reset causes.
1. Kernel panic — a panic notifier writes PSCR_KERNEL_PANIC to NVMEM
before the system resets, so the next boot can distinguish a panic
from other reset causes.
2. Watchdog pretimeout — set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT) is
called from pretimeout_panic(), when the watchdog fire its
pre-reset notification before resetting the system, so the reason gets
saved and we know its was a watchdog timeout that caused the reset.
Changes in v4:
- correct 2/3 patch.
- v3-link: [4]
Changes in v3:
- Update patch 3/3 based on Guenter Roeck's feedback:
* Move set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT) from
watchdog_notify_pretimeout() to pretimeout_panic().
- v2-link: [3]
Changes in v2:
- Split patch 2/2 into two patches as requested by Guenter Roeck:
* Patch 2/3: power/reset — add PSCR_WATCHDOG_PRETIMEOUT and guard
panic notifier against overwriting watchdog reason.
* Patch 3/3: watchdog — hook set_psc_reason() into
watchdog_notify_pretimeout().
- v1-link: [2]
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/
[4] https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Faruque Ansari <[email protected]>
---
Faruque Ansari (3):
power: reset: pscrr: add kernel panic reason tracking
power: reset: pscrr: add watchdog pretimeout reason tracking
watchdog: pretimeout: update PSC reason in panic pretimeout governor
drivers/power/reset/pscrr/pscrr.c | 30 ++++++++++++++++++++++++++++++
drivers/watchdog/pretimeout_panic.c | 2 ++
include/linux/power/power_on_reason.h | 2 ++
include/linux/reboot.h | 7 +++++++
kernel/reboot.c | 2 ++
5 files changed, 43 insertions(+)
---
base-commit: 551961df5728932d968a4aae534714acfa43f3a1
change-id: 20260803-pscrr-reboot-reason-f1254965ec0d
Best regards,
--
Faruque Ansari <[email protected]>