[PATCH 0/2] power: reset: pscrr: record reset cause on panic and watchdog pretimeout

Faruque Ansari posted 2 patches 1 week, 4 days ago
There is a newer version of this series
drivers/power/reset/pscrr.c            | 33 +++++++++++++++++++++++++++++++++
drivers/watchdog/watchdog_pretimeout.c |  3 +++
include/linux/power/power_on_reason.h  |  2 ++
include/linux/reboot.h                 |  2 ++
kernel/reboot.c                        |  2 ++
5 files changed, 42 insertions(+)
[PATCH 0/2] power: reset: pscrr: record reset cause on panic and watchdog pretimeout
Posted by Faruque Ansari 1 week, 4 days ago
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 watchdog_notify_pretimeout(), 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.

[1] https://lore.kernel.org/lkml/20250618120255.3141862-1-o.rempel@pengutronix.de/

To: Sebastian Reichel <sre@kernel.org>
To: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Guenter Roeck <linux@roeck-us.net>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Benson Leung <bleung@chromium.org>
To: Tzung-Bi Shih <tzungbi@kernel.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
Cc: linux-arm-msm@vger.org
Cc: kernel@pengutronix.de
Cc: Liam Girdwood" <lgirdwood@gmail.com>
Cc: Mark Brown" <broonie@kernel.org>
Cc: Rafael J. Wysocki" <rafael@kernel.org>
Cc: Zhang Rui" <rui.zhang@intel.com>
Cc: Lukasz Luba" <lukasz.luba@arm.com>
Cc: Søren Andersen" <san@skov.dk>
Cc: Guenter Roeck" <groeck@chromium.org>
Cc: Matti Vaittinen" <mazziesaccount@gmail.com>
Cc: Ahmad Fatoum" <a.fatoum@pengutronix.de>
Cc: Andrew Morton" <akpm@linux-foundation.org>
Cc: avaneesh.dwivedi@oss.qualcomm.com
Cc: Umang Chheda <umang.chheda@oss.qualcomm.com>

Signed-off-by: Faruque Ansari <faruque.ansari@oss.qualcomm.com>
---
Faruque Ansari (2):
      power: reset: pscrr: add kernel panic reason tracking
      watchdog: pscrr: add watchdog pretimeout reason tracking

 drivers/power/reset/pscrr.c            | 33 +++++++++++++++++++++++++++++++++
 drivers/watchdog/watchdog_pretimeout.c |  3 +++
 include/linux/power/power_on_reason.h  |  2 ++
 include/linux/reboot.h                 |  2 ++
 kernel/reboot.c                        |  2 ++
 5 files changed, 42 insertions(+)
---
base-commit: 9696e3e0e12695f18c26e339bc609a2d56b51c5a
change-id: 20260714-pscrr-reboot-reason-2b4e16ccb6b8

Best regards,
-- 
Faruque Ansari <faruque.ansari@oss.qualcomm.com>

Re: [PATCH 0/2] power: reset: pscrr: record reset cause on panic and watchdog pretimeout
Posted by Oleksij Rempel 1 week, 3 days ago
Hi Faruque,

On Tue, Jul 14, 2026 at 03:22:33PM +0530, Faruque Ansari wrote:
> 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 watchdog_notify_pretimeout(), 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.

Thank you, LGTM!

Right now I'm on a netdev conference, will need to take a closer look
after it.

Best Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |