[PATCH v5 0/5] power: reset: pscrr: add support for additional reset reasons
From: Faruque Ansari
Date: Mon Nov 23 2026 - 02:06:09 EST
This series extends the Power State Change Reason Register (PSCRR) [1]
framework to capture 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.
3. Kernel watchdog - Dedicated PSCR_KERNEL_WATCHDOG_HARDLOCKUP and
PSCR_KERNEL_WATCHDOG_SOFTLOCKUP reasons are recorded when hardlockup
and softlockup events are detected by the kernel watchdog, allowing
these reset events to be identified on subsequent boots.
4. Userspace-initiated reboots — add dedicated reset reason codes for
bootloader, recovery, OTA update, EDL and factory-reset reboot requests.
Changes in v5:
- Remove the hard-coded pretimeout check and use the generic - Daniel Lezcano
- Add kernel watchdog record reason patch 4/5.
- Add userspace-initiated record reason patch 5/5
- v4-link: [5]
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/20261019-pscrr-framework-v17-0-69ea6cdf4731@xxxxxxxxxxxxxxxx/
[2] https://lore.kernel.org/all/20260714-pscrr-reboot-reason-v1-0-a09f23b12527@xxxxxxxxxxxxxxxx/
[3] https://lore.kernel.org/lkml/20260722-pscrr-reboot-reason-v2-0-495ba3005953@xxxxxxxxxxxxxxxx/
[4] https://lore.kernel.org/lkml/20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@xxxxxxxxxxxxxxxx/
[5] https://lore.kernel.org/r/20260805-pscrr-reboot-reason-v4-0-54ef517084cc@xxxxxxxxxxxxxxxx
Signed-off-by: Faruque Ansari <faruque.ansari@xxxxxxxxxxxxxxxx>
---
Faruque Ansari (5):
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
power: reset: pscrr: add kernel watchdog reason tracking
power: reset: pscrr: record reason for userspace-initiated reboots
drivers/power/reset/pscrr/pscrr.c | 39 +++++++++++++++++++++++++++----
drivers/watchdog/pretimeout_panic.c | 2 ++
include/linux/power/power_on_reason.h | 9 +++++++
include/linux/reboot.h | 38 ++++++++++++++++++++++++++++++
kernel/reboot.c | 44 +++++++++++++++++++++++++++++++++++
kernel/watchdog.c | 9 +++++--
6 files changed, 135 insertions(+), 6 deletions(-)
---
base-commit: 551961df5728932d968a4aae534714acfa43f3a1
change-id: 20260803-pscrr-reboot-reason-f1254965ec0d
Best regards,
--
Faruque Ansari <faruque.ansari@xxxxxxxxxxxxxxxx>