[PATCH v4 0/3] power: reset: Add NVMEM recorder provider for PSCRR
From: Faruque Ansari
Date: Fri Oct 23 2026 - 05:19:07 EST
The PSCRR framework[1] currently does not provide a recorder provider
capable of persisting power state change reasons across power cycles.
This series extends the PSCRR framework[1] with support for an
NVMEM-cell recorder provider, integrating PSCRR-recorded power state
change reasons with the NVMEM subsystem.
The recorder writes the power state change reason into a small NVMEM cell
(e.g. a PMIC SDAM byte or RTC scratch register) before shutdown or reset,
so the cause survives a power cycle and is available via
/sys/kernel/pscrr/ on the next boot.
Only the NVMEM-cell provider is included here. The PMIC hardware-register
provider will be submitted as a separate series.
[1] https://lore.kernel.org/all/20261019-pscrr-framework-v17-0-69ea6cdf4731@xxxxxxxxxxxxxxxx/
---
Changes in v4:
- Move the PSCRR NVMEM provider recorder from drivers/power/reset/pscrr/
to drivers/nvmem/layouts/ and relocate its Kconfig/Makefile/MAINTAINERS
entries accordingly, as suggested by Srinivas Kandagatla.
- Reject a layout that declares more than one reason cell with -EINVAL
instead of silently using the first one - Srinivas Kandagatla.
- Consolidate the probe error paths onto a single of_node_put() unwind
label instead of repeating the put on every failure - Srinivas Kandagatla.
- add Reviewed-by tags from Abel Vesa and Rob Herring.
- Link to v3: https://lore.kernel.org/r/20260914-pscrr-provider-v3-0-c45cb16542e8@xxxxxxxxxxxxxxxx
Changes in v3:
- Drop unnecessary nvmem_cell_get_size() and core compatibility
detection changes because the layout now owns the compatible.
- Patch 1/3 (dt-bindings): Move compatible from the cell to the
nvmem-layout node, relocate binding to nvmem/layouts/, and
simplify the cell to a plain reg/bits child.
- Drop the trailing "binding" from the subject, as suggested by
Krzysztof.
- Patch 2/3 (driver): Convert pscrr-nvmem from a consumer-based
platform driver to an nvmem_layout_driver that directly manages
its cell.
- Patch 3/3 (dts): Update DTS to place compatible on the layout
node, add bits to reboot_reason_persist, and remove the separate
reboot-reason consumer node.
- Link to v2: https://patch.msgid.link/20260819-pscrr-provider-v2-0-9072383e0f4d@xxxxxxxxxxxxxxxx
Changes in v2:
- Add reviewers to To/Cc list.
- Update patch 1/4:
* Rename DT node from pscr-reason to reboot-reason.
* Update DT binding example to use fixed-layout NVMEM layout.
* Add reboot_reason_persist NVMEM cell under fixed-layout.
* Update Qualcomm DTS example accordingly.
- Update patch 2/4 based on Uwe Kleine-König feedback:
* Remove unnecessary #include <linux/mod_devicetable.h>
- Link to v1: https://lore.kernel.org/all/20260817-pscrr-provider-v1-0-88a318c13d41@xxxxxxxxxxxxxxxx/
---
Faruque Ansari (3):
dt-bindings: nvmem: layouts: Add PSCRR NVMEM layout
power: reset: Add PSCRR NVMEM recorder
arm64: dts: qcom: lemans: Add PSCRR NVMEM recorder node
.../bindings/nvmem/layouts/nvmem-layout.yaml | 1 +
.../bindings/nvmem/layouts/pscrr-nvmem.yaml | 87 +++++++
MAINTAINERS | 2 +
arch/arm64/boot/dts/qcom/lemans-pmics.dtsi | 11 +
drivers/nvmem/layouts/Kconfig | 10 +
drivers/nvmem/layouts/Makefile | 1 +
drivers/nvmem/layouts/pscrr-nvmem.c | 270 +++++++++++++++++++++
7 files changed, 382 insertions(+)
---
base-commit: be461b2185ea3ff6d9c92deedcee0a62a57e1332
change-id: 20260806-pscrr-provider-b9f8f451701e
Best regards,
--
Faruque Ansari <faruque.ansari@xxxxxxxxxxxxxxxx>