From: Faruque Ansari <faruque.ansari@oss.qualcomm.com>
To: Sebastian Reichel <sre@kernel.org>,
Benson Leung <bleung@chromium.org>,
Tzung-Bi Shih <tzungbi@kernel.org>,
Guenter Roeck <groeck@chromium.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Matti Vaittinen <mazziesaccount@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev,
avaneesh.dwivedi@oss.qualcomm.com,
Umang Chheda <umang.chheda@oss.qualcomm.com>,
Faruque Ansari <faruque.ansari@oss.qualcomm.com>
Subject: [PATCH v13 6/6] Documentation: Add sysfs documentation for PSCRR
Date: Mon, 21 Sep 2026 22:27:14 +0530 [thread overview]
Message-ID: <pscrr-v13-6-dfc57fceede5@oss.qualcomm.com> (raw)
In-Reply-To: <pscrr-v13-0-dfc57fceede5@oss.qualcomm.com>
Document the Power State Change Reasons Recording (PSCRR) sysfs interface
under /sys/kernel/pscrr/: the per-provider directories and their name,
device, reason, caps, supported_reasons and record_policy attributes,
including the stable reason token values.
Co-developed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Faruque Ansari <faruque.ansari@oss.qualcomm.com>
changes v12:
- rewrite for the per-provider interface (providerN/ directories with
caps, supported_reasons and record_policy)
- rename the file to sysfs-kernel-pscrr to match the sysfs path
- refresh KernelVersion/Date
- drop Reviewed-by: Matti Vaittinen; the documentation was rewritten
changes v8:
- simplify and clarify example sysfs value comments
- add note that not all values are meaningful on every system
changes v7:
- document expected values
---
Documentation/ABI/testing/sysfs-kernel-pscrr | 108 +++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-kernel-pscrr b/Documentation/ABI/testing/sysfs-kernel-pscrr
new file mode 100644
index 000000000000..63aa411b7362
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-pscrr
@@ -0,0 +1,108 @@
+What: /sys/kernel/pscrr/
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ Root directory of the Power State Change Reason Recording
+ (PSCRR) framework. It contains one subdirectory per registered
+ reason provider, named providerN (N is an arbitrary, stable
+ index assigned at registration).
+
+ A provider is either a hardware reason source (a PMIC, SoC
+ reset controller or watchdog exposing a reset cause) or a
+ recorder that persists the current reason across a power cycle
+ (e.g. an NVMEM or RTC scratch cell). The set of reasons is
+ deliberately not collapsed to a single "winning" cause, since
+ resets are often multi-causal.
+
+What: /sys/kernel/pscrr/providerN/name
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ (RO) Human-readable label identifying the provider, e.g.
+ "pca9450" or "nvmem".
+
+What: /sys/kernel/pscrr/providerN/device
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ Symbolic link to the backing struct device of the provider.
+ Present only for providers that are bound to a device.
+
+What: /sys/kernel/pscrr/providerN/reason
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ The set of power state change reasons observed by this
+ provider, as a space-separated list of reason tokens (an
+ empty line means no reason is recorded).
+
+ The attribute is writable only for providers that can record
+ a reason; for a pure hardware source it is read-only. A write
+ records one reason and accepts either a reason token or its
+ decimal index. The tokens and their stable numeric values are:
+
+ == ================= ============================================
+ 0 unknown Unknown or unspecified reason
+ 1 under-voltage Supply voltage dropped below a safe level
+ 2 over-current Excessive current draw / possible short
+ 3 regulator-failure Voltage regulator failure
+ 4 over-temperature Unsafe temperature detected
+ 5 ec-panic Embedded controller (EC) panic
+ 6 power-on Regular cold power-on
+ 7 watchdog Watchdog timeout
+ 8 software Software-initiated reset or reboot
+ 9 external External reset input asserted
+ 10 rtc RTC-triggered wake-up or power-on
+ 11 reset-button User reset button
+ 12 cpu-clock-failure CPU clock failure
+ 13 crystal-failure Crystal oscillator failure
+ == ================= ============================================
+
+ The numeric order is stable ABI: new reasons are only ever
+ appended. A provider may support only a subset of these; see
+ "supported_reasons".
+
+What: /sys/kernel/pscrr/providerN/caps
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ (RO) Space-separated list of the provider's non-default
+ capabilities. Being readable and storing a single reason are
+ the defaults and are not listed. Currently defined:
+
+ ======== ==============================================
+ writable the provider can record a reason (see "reason"
+ and "record_policy")
+ ======== ==============================================
+
+ An empty line therefore denotes a read-only, single-slot
+ provider.
+
+What: /sys/kernel/pscrr/providerN/supported_reasons
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ (RO) Space-separated list of the reason tokens (see "reason")
+ this provider is able to report or record. A provider that
+ supports every reason lists them all.
+
+What: /sys/kernel/pscrr/providerN/record_policy
+Date: July 2026
+KernelVersion: 7.2
+Contact: Oleksij Rempel <o.rempel@pengutronix.de>
+Description:
+ (RW) Policy used when more than one reason is recorded during a
+ single power cycle. Present only for providers that can record
+ (see "caps"). Valid values are:
+
+ ===== =================================================
+ first keep the first reason recorded this cycle (the
+ root cause); this is the default
+ last overwrite with the most recently recorded reason
+ ===== =================================================
--
2.34.1
prev parent reply other threads:[~2026-09-21 16:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 9:59 [PATCH v12 0/6] Introduce the Power State Change Reasons Recording (PSCRR) framework Oleksij Rempel
2026-07-31 9:59 ` [PATCH v12 1/6] power: Extend power_on_reason.h for upcoming PSCRR framework Oleksij Rempel
2026-07-31 9:59 ` [PATCH v12 2/6] reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings Oleksij Rempel
2026-07-31 9:59 ` [PATCH v12 3/6] reboot: add parsable tokens for power state change reasons Oleksij Rempel
2026-07-31 9:59 ` [PATCH v12 4/6] reboot: extend psc_reason with power-on and reset causes Oleksij Rempel
2026-07-31 9:59 ` [PATCH v12 5/6] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage Oleksij Rempel
2026-08-23 15:28 ` Francesco Valla
2026-07-31 9:59 ` [PATCH v12 6/6] Documentation: Add sysfs documentation for PSCRR Oleksij Rempel
2026-08-05 9:34 ` [PATCH v12 0/6] Introduce the Power State Change Reasons Recording (PSCRR) framework Faruque Ansari
2026-08-05 11:07 ` Oleksij Rempel
2026-09-21 16:57 ` [PATCH v13 0/6] power: reset: " Faruque Ansari
2026-09-21 16:57 ` [PATCH v13 1/6] power: Extend power_on_reason.h for upcoming PSCRR framework Faruque Ansari
2026-09-21 16:57 ` [PATCH v13 2/6] reboot: hw_protection_trigger: use standardized numeric shutdown/reboot reasons instead of strings Faruque Ansari
2026-09-21 16:57 ` [PATCH v13 3/6] reboot: add parsable tokens for power state change reasons Faruque Ansari
2026-09-21 16:57 ` [PATCH v13 4/6] reboot: extend psc_reason with power-on and reset causes Faruque Ansari
2026-09-21 16:57 ` [PATCH v13 5/6] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage Faruque Ansari
2026-09-21 16:57 ` Faruque Ansari [this message]
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=pscrr-v13-6-dfc57fceede5@oss.qualcomm.com \
--to=faruque.ansari@oss.qualcomm.com \
--cc=avaneesh.dwivedi@oss.qualcomm.com \
--cc=bleung@chromium.org \
--cc=broonie@kernel.org \
--cc=chrome-platform@lists.linux.dev \
--cc=daniel.lezcano@kernel.org \
--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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®