All of lore.kernel.org
 help / color / mirror / Atom feed
From: Faruque Ansari <faruque.ansari@oss.qualcomm.com>
To: Bradley Morgan <brads@mainlining.org>
Cc: avaneesh.dwivedi@oss.qualcomm.com, bleung@chromium.org,
	broonie@kernel.org, chrome-platform@lists.linux.dev,
	daniel.lezcano@kernel.org, francesco@valla.it,
	groeck@chromium.org, kernel@pengutronix.de, lgirdwood@gmail.com,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, lukasz.luba@arm.com,
	mazziesaccount@gmail.com, o.rempel@pengutronix.de,
	rafael@kernel.org, rui.zhang@intel.com,
	sebastian.reichel@collabora.com, sre@kernel.org,
	tzungbi@kernel.org, umang.chheda@oss.qualcomm.com
Subject: Re: [PATCH v14 0/6] power: reset: Introduce the Power State Change Reasons Recording (PSCRR) framework
Date: Tue, 22 Sep 2026 12:14:40 +0530	[thread overview]
Message-ID: <42487beb-29af-49f3-95da-a05ab7faf8c3@oss.qualcomm.com> (raw)
In-Reply-To: <2F1E7C6E-897D-40BF-A37E-EAF42C4A0CA5@mainlining.org>

Hi Bradley Morgan,

On 22-Sep-26 12:03 PM, Bradley Morgan wrote:
> On 21 September 2026 18:44:15 BST, Faruque Ansari
> <faruque.ansari@oss.qualcomm.com> wrote:
>> Hello all,
>>
>> A system power-state transition - a shutdown or a reboot - rarely has a
>> single, unambiguous cause, and no one component sees the whole picture:
>> the
>> PMIC, the watchdog, the SoC reset registers, the bootloader and software
>> each
>> only know their own part, so there is no single source of truth.
>>
>> PSCRR gives these sources one central place to report side by side. Every
>> provider keeps its own view - several providers, and several reasons
>> within a
>> provider, can be reported at once and are deliberately not collapsed into
>> a
>> single "winning" cause (a bit of a minority report). On top of that it
>> adds a
>> software-backed recorder, so software-detected reasons - under-voltage,
>> over-temperature, a watchdog pretimeout, a panic, a controlled reboot -
>> are
>> captured too and survive into the next boot.
>>
>> The NVMEM-cell binding a recorder needs to pick its storage is still
>> deadlocked, and several projects already need the framework, so this v13
>> posts the framework, its reboot/reason infrastructure and the sysfs
>> documentation only; the provider drivers (NVMEM, PMIC, ...) and the tests
>> follow separately once the binding is resolved. One built-in provider,
>> reporting the bootloader's device-tree /chosen/reset-source, is kept so
>> the
>> framework is useful on its own without a new binding.
>>
>> For followup drivers, see:
>> https://github.com/olerem/linux-2.6/tree/v7.2/topic/pscr-v12
>>
>> Changes in v14:
>> - Ignore v13, it was mistakenly posted as a reply to Oleksij's v12
>>   patch series.
>>
>> Changes in v13:
>> - Rework pscrr_provider_register() based on review feedback from Francesco Valla:
>>   move the pscrr_root check before allocation and narrow pscrr_lock scope.
>> - Carry the series forward with Faruque Ansari as author and Oleksij
>>   Rempel as co-developer, and vice versa where required.
>> - Link to v12: https://lore.kernel.org/r/20260731095959.296056-1-o.rempel@pengutronix.de
>>
>> Changes in v12:
>> - Drop all provider drivers and their tests; post the framework alone. The
>>   NVMEM-cell binding a recorder needs to pick its storage is still
>>   deadlocked, and several projects already need the framework - so unblock
>>   the core now and let the providers (NVMEM, PMIC, ...) follow separately.
>> - Rework into a multi-provider design (per-provider /sys/kernel/pscrr/
>>   directories); add reason tokens and a built-in /chosen/reset-source
>>   provider.
>>
>> Changes in v11:
>> - add missing break reported by kernel test robot <lkp@intel.com>
>>
>> Changes in v10:
>> - add some add Reviewed-by tags
>> - regulator_handle_critical: set pscr = PSCR_UNKNOWN for default case
>> - make g_pscrr static
>>
>> Changes in v9:
>> - Remove redundant pr_crit() messages before hw_protection_trigger()
>> - Replace psc_reason_to_str() switch with static const string array
>> - Mark psc_last_reason as static
>>
>> Changes in v8:
>> - Use DEFINE_GUARD() and guard(g_pscrr) for scoped locking of the global
>>   pscrr_core struct
>> - Replace manual mutex_lock/unlock with automatic cleanup-based guard() usage
>> - Centralize backend and locking state in struct pscrr_core
>> - Prepare for future multi-backend support with clean encapsulation
>> - Improve sysfs documentation
>>
>> Changes in v7:
>> - document expected values in sysfs documentation
>> - make write support optional
>>
>> Changes in v6:
>> - add sysfs documentation
>> - push core part of the reset reason into kernel/reboot.c
>>
>> Changes in v5:
>> - fix compile with NVMEM=n and potential issues with NVMEM=m
>>
>> Changes in v4:
>> - fix compile with CONFIG_PSCRR=n
>>
>> Changes in v3:
>> - rework to remove devicetree dependencies
>> - extend NVMEM to search devices and cells by names
>>
>> Changes in v2:
>> - rename the framework from PSCR to PSCRR (last R is for Recorder)
>> - extend the power-on reason header and reuse it for the detected reason
>> - rebase on top of v6.8-rc1
> 
> Hey, I dont see the use to PSCRR, are you planning to ship any providers?

I have already posted the NVMEM cell provider support as a 
separate email thread.

https://lore.kernel.org/all/20260914-pscrr-provider-v3-0-c45cb16542e8@oss.qualcomm.com/

Thanks,
Faruque Ansari


>>
>> Signed-off-by: Faruque Ansari <faruque.ansari@oss.qualcomm.com>
>> ---
>> Faruque Ansari (6):
>>       power: Extend power_on_reason.h for upcoming PSCRR framework
>>       reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings
>>       reboot: add parsable tokens for power state change reasons
>>       reboot: extend psc_reason with power-on and reset causes
>>       power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage
>>       Documentation: Add sysfs documentation for PSCRR
>>
>> Documentation/ABI/testing/sysfs-kernel-pscrr | 108 +++++
>> MAINTAINERS                                  |  11 +
>> drivers/platform/chrome/cros_ec_lpc.c        |   2 +-
>> drivers/power/reset/Kconfig                  |   2 +
>> drivers/power/reset/Makefile                 |   1 +
>> drivers/power/reset/pscrr/Kconfig            |  33 ++
>> drivers/power/reset/pscrr/Makefile           |   2 +
>> drivers/power/reset/pscrr/pscrr.c            | 633
>> +++++++++++++++++++++++++++
>> drivers/regulator/core.c                     |  16 +-
>> drivers/regulator/irq_helpers.c              |   9 +-
>> drivers/thermal/thermal_core.c               |   3 +-
>> include/linux/power/power_on_reason.h        |   5 +
>> include/linux/pscrr.h                        | 107 +++++
>> include/linux/reboot.h                       | 108 ++++-
>> kernel/reboot.c                              | 165 ++++++-
>> 15 files changed, 1183 insertions(+), 22 deletions(-)
>> ---
>> base-commit: 5c4d4169604b335c38bbc79bc1fc03042981fc6f
>> change-id: 20260921-pscrr-framework-25f48818efe8
>>
>> Best regards,
>>
> 
> --- Thanks!
> "I'm not a very positive person" - Linus torvalds


  reply	other threads:[~2026-09-22  6:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 17:44 [PATCH v14 0/6] power: reset: Introduce the Power State Change Reasons Recording (PSCRR) framework Faruque Ansari
2026-09-21 17:44 ` [PATCH v14 1/6] power: Extend power_on_reason.h for upcoming PSCRR framework Faruque Ansari
2026-09-22  6:02   ` Matti Vaittinen
2026-09-21 17:44 ` [PATCH v14 2/6] reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings Faruque Ansari
2026-10-02  7:47   ` Daniel Lezcano
2026-10-05 12:27     ` Faruque Ansari
2026-09-21 17:44 ` [PATCH v14 3/6] reboot: add parsable tokens for power state change reasons Faruque Ansari
2026-09-22  7:37   ` Matti Vaittinen
2026-09-23 11:05     ` Faruque Ansari
2026-09-21 17:44 ` [PATCH v14 4/6] reboot: extend psc_reason with power-on and reset causes Faruque Ansari
2026-09-22  7:45   ` Matti Vaittinen
2026-09-23 11:05     ` Faruque Ansari
2026-09-21 17:44 ` [PATCH v14 5/6] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage Faruque Ansari
2026-09-22  9:03   ` Matti Vaittinen
2026-09-23 11:06     ` Faruque Ansari
2026-09-21 17:44 ` [PATCH v14 6/6] Documentation: Add sysfs documentation for PSCRR Faruque Ansari
2026-09-22  9:12   ` Matti Vaittinen
2026-09-22  6:33 ` [PATCH v14 0/6] power: reset: Introduce the Power State Change Reasons Recording (PSCRR) framework Bradley Morgan
2026-09-22  6:44   ` Faruque Ansari [this message]
2026-09-24  7:08 ` [PATCH v15 " Faruque Ansari
2026-09-24  7:08   ` [PATCH v15 1/6] power: Extend power_on_reason.h for upcoming PSCRR framework Faruque Ansari
2026-10-01 20:22     ` Daniel Lezcano
2026-10-02  4:22       ` Oleksij Rempel
2026-10-02  7:07     ` Daniel Lezcano
2026-09-24  7:08   ` [PATCH v15 2/6] reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings Faruque Ansari
2026-09-24  7:08   ` [PATCH v15 3/6] reboot: add parsable tokens for power state change reasons Faruque Ansari
2026-10-02  7:53     ` Daniel Lezcano
2026-09-24  7:08   ` [PATCH v15 4/6] reboot: extend psc_reason with power-on and reset causes Faruque Ansari
2026-09-24 12:14     ` Matti Vaittinen
2026-09-24  7:08   ` [PATCH v15 5/6] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage Faruque Ansari
2026-10-02  9:06     ` Daniel Lezcano
2026-10-05 12:26       ` Faruque Ansari
2026-09-24  7:08   ` [PATCH v15 6/6] Documentation: Add sysfs documentation for PSCRR Faruque Ansari
2026-09-25 17:34 ` [PATCH v14 0/6] power: reset: Introduce the Power State Change Reasons Recording (PSCRR) framework Bradley Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42487beb-29af-49f3-95da-a05ab7faf8c3@oss.qualcomm.com \
    --to=faruque.ansari@oss.qualcomm.com \
    --cc=avaneesh.dwivedi@oss.qualcomm.com \
    --cc=bleung@chromium.org \
    --cc=brads@mainlining.org \
    --cc=broonie@kernel.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=daniel.lezcano@kernel.org \
    --cc=francesco@valla.it \
    --cc=groeck@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mazziesaccount@gmail.com \
    --cc=o.rempel@pengutronix.de \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=sre@kernel.org \
    --cc=tzungbi@kernel.org \
    --cc=umang.chheda@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.