[PATCH v25 00/10] Implement PSCI reboot mode driver for PSCI resets
From: Shivendra Pratap <hidden>
Date: 2026-09-14 14:59:41
Also in:
linux-arm-msm, linux-devicetree, linux-pm, lkml
Userspace should be able to initiate device reboots using the various PSCI SYSTEM_RESET and SYSTEM_RESET2 types defined by PSCI spec. This patch series introduces psci-reboot-mode driver that will induce command-based resets to psci driver for executing the device reset. The PSCI system reset calls takes two arguments: reset_type and cookie. It defines predefined reset types, such as warm and cold reset, and vendor-specific reset types which are SoC vendor specific. To support these requirements, the reboot-mode framework is enhanced in two key ways: 1. Support upto three 32 bit magic values as arguments. This enables to support for a 32 bit reset_type and a 64 bit cookie). 2. Predefined modes: Add support for predefined reboot modes in the framework. With these enhancements, the patch series enables: - Arch Warm reset and system reset cold as predefined reboot modes. - Vendor-specific resets, configurable via the SoC-specific device tree. Together, these changes allow userspace to trigger all above PSCI resets from userspace. Note on introducing psci aux devices: Based on feedback from Bart, Lee and Ufee, PSCI child functionality now uses aux devices instead of an MFD driver, with psci-cpuidle-domain and psci-reboot-mode probed through a common PSCI aux device enumerator. Reference discussions on this: https://lore.kernel.org/all/CAPx+jO9Hi2R_UnCEhsXLwf74c3RTb+RodaJ6SOVXbQX_eHt++A@mail.gmail.com/ (local) --- The patch is tested on rb3Gen2, lemans-ride, lemans-evk, monaco-ride, qcs615-ride. Signed-off-by: Shivendra Pratap <redacted> Changes in v25: By Bart/Lee/Ufee: Dropped: - mfd: core: Add firmware-node support to MFD cells - mfd: psci-mfd: Add PSCI MFD driver for cpuidle-psci-domain cell - mfd: psci-mfd: Add psci-reboot-mode child cell firmware: psci: Add support for PSCI auxiliary devices - Added a PSCI platform driver to enumerate auxiliary devices. - Converted psci-cpuidle-domain enumeration to the auxiliary device model. - Added optional psci-reboot-mode auxiliary device creation. - Added MAINTAINERS entry and updated Kconfig help text. power: reset: Add psci-reboot-mode driver - Moved PSCI reboot-mode support to an auxiliary-bus based driver. By Rob: dt-bindings: arm: Document reboot mode magic - Addressed format chnages. - Fixed dtbinding check error on maxitem. By sashiko/ Alignment: power: reset: Add psci-reboot-mode driver - Added a 32-bit system check for 3-cell cookies. - Added stricter magic value count checks as per the PSCI reboot-mode ABI. - Added in-code documentation for predefined PSCI reset modes and cookie layout. - Avoid registering the DT reboot-mode node when SYSTEM_RESET2 is unsupported. firmware: psci: Introduce command-based resets - Added 32-bit validation for PSCI reset command cookies. - Updated psci_set_reset_cmd() documentation for PSCI SYSTEM_RESET2 reset_type. - Link to v24: https://patch.msgid.link/20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com Changes in v24: mfd: psci-mfd: Add psci-reboot-mode child cell - Remove the explicit check for availability of the reboot-mode node. (by Bart) - Fail psci-mfd probe only on fatal errors(-ENOMEM) while adding the psci-reboot-mode cell. mfd: core: Add firmware-node support for MFD cells - Allow MFD child registration even when a named child cell not present, to align with of_compatible-based registration. (by sashiko) - Move named_fwnode logic to a separate function. power: reset: Add psci-reboot-mode driver - Remove dependency on OF. (by Pavan) - Update for new changes in predefined modes. dt-bindings: arm: Document reboot-mode magic - Fix the example DT entry. (by Rob) - Use unevaluatedProperties as false for the reboot-mode child schema. firmware: psci: Introduce command-based resets - Update in-code documentation. (by Pavan) - Update namespace-based exports. (by Pavan) - Use synchronized write/read (smp_store_release / smp_load_acquire)for the reset command to support lockless atomic reads. (by sashiko) power: reset: reboot-mode: Add support for predefined reboot modes - Remove the predefined list in reboot-mode and add a pointer to reboot_mode_entry. (by Pavan) - The registering driver fills and manages reboot_mode_entry. (by Pavan) - reboot-mode list to append reboot_mode_entry. power: reset: reboot-mode: Support up to 3 magic values per mode - Add separate write function pointers for single-magic writes (existing drivers) and multi-value writes. (by Pavan/Bart) - Update count to u32. (by Pavan) power: reset: reboot-mode: Remove devres-based allocations - Drop from this series, Sent as separate split-fixes patch. - Link to v23: https://patch.msgid.link/20260714-arm-psci-system_reset2-vendor-reboots-v23-0-e7453c548c21@oss.qualcomm.com Changes in v23: mfd: core: Add firmware-node support to MFD cells - Add named_fwnode-based firmware node support in MFD cells.(by Bart) - Update the release path. (by Bart) - Add checks for duplicate fwnodes. - Update documentation for usage and limitations. mfd: psci-mfd: Add psci-reboot-mode child cell - Update for a named_fwnode-based reboot-mode child cell. (By Bart) - Split psci-reboot-mode and psci-cpuidle-domain into separate child cells. power: reset: Add psci-reboot-mode driver - Add COMPILE_TEST in Kconfig. (by Bart) - Update to support up to three u32 arguments to accommodate a 32-bit reset_type and a 64-bit cookie. (By Sashiko, Lorenzo) dt-bindings: arm: Document reboot mode magic - Update to support up to three u32 arguments to accommodate a 32-bit reset_type and a 64-bit cookie. - Dropped reviewed by from Bart and Rob due to considerable changes. firmware: psci: Introduce command-based resets - Update to support a 64-bit cookie. (By Sashiko, Lorenzo) - Update the flow so unsupported reset commands and any failures during reset command execution fall back to the Linux reboot_mode path. (By Sashiko) power: reset: reboot-mode: Add support for predefined reboot modes - Handle errors and free lists in devm_reboot_mode_register(). (by Sashiko) - Update to support up to three u32 arguments. power: reset: reboot-mode: Support up to 3 magic values per mode - Patch for 64 bit magic renamed. - Update to support up to three u32 arguments to accommodate a 32-bit reset_type and a 64-bit cookie. - Dropped reviewed by from Bart and Sebastian due to considerable changes. - Link to v22: https://lore.kernel.org/r/20260514-arm-psci-system_reset2-vendor-reboots-v22-0-28a5bde07483@oss.qualcomm.com (local) Changes in v22: By Bart: power: reset: reboot-mode: Add support for predefined reboot modes - Add reboot-mode helper to add predefined modes. - Add centralized init for reboot-mode. - Dropping Reviewed-by from Bartosz as changes may need a review. power: reset: Add psci-reboot-mode driver - Use reboot-mode helpers to initialize reboot-mode driver and add predefined modes. mfd: core: Add firmware-node support to MFD cells - Use callback function to get fwnode from a MFD child cell. mfd: psci-mfd: Add psci-reboot-mode child cell - Use callback function to return fwnode for reboot-mode. By Pankaj: mfd: psci-mfd: Add PSCI MFD driver for cpuidle-psci-domain cell - Make MFD_PSCI defaults to y as ARM_PSCI_CPUIDLE_DOMAIN defaults to y and depends on it. - Link to v21: https://lore.kernel.org/r/20260427-arm-psci-system_reset2-vendor-reboots-v21-0-dcf937775e73@oss.qualcomm.com (local) Changes in v21: By Krzysztof power: reset: reboot-mode: Remove devres based allocations - remove fixes tag. By Lorenzo firmware: psci: Introduce command-based resets - psci_set_reset_cmd() only takes reset_type/cookie as input params. - updated this as a encoded u64 reset_command - from Pavan Kondeti. - Update commit text for reason for explicit panic_handling. - Clean split of reset flow in psci_sys_reset via handle_reboot_mode and handle_cmd_reset. - Add psci_has_system_reset2_support() helper and PSCI reset-type defines. By Lorenzo/Bart power: reset: Add psci-reboot-mode driver By Bart - Drop faux-device based probe. - Convert driver to platform-driver model (probed via PSCI MFD). By Lorenzo: - Use PSCI-specific predefined reset mode naming/magic. - Register arch-warm predefined mode only when SYSTEM_RESET2 is supported. - psci_reboot_mode_write to directly pass reset_type and cokie. - Add MAINTAINERS entry for drivers/power/reset/psci-reboot-mode.c. By Bart mfd: psci-mfd: Introduce psci mfd driver for cpuidle-psci-domain cell - Introduce psci-mfd driver. mfd: Add psci-reboot-mode cell via fwnode - Register psci-reboot-mode from psci-mfd with reboot-mode child node fwnode. - Update reset Kconfig dependency to tie PSCI reboot-mode to MFD PSCI path. For alignment: - mfd: core: Add firmware-node support to MFD cells - Add firmware-node support to MFD cells. By Pavan power: reset: reboot-mode: Add support for predefined reboot modes - Move redundant logic of adding modes to list to a common function. By Arnd - Remove refrences for Linux reboot-modes from code and commit text. By Konrad - Updated all dt changes to add reboot-mode for supported board files. - Link to v20: https://lore.kernel.org/r/20260304-arm-psci-system_reset2-vendor-reboots-v20-0-cf7d346b8372@oss.qualcomm.com (local) Changes in v20: By Bart: power: reset: Add psci-reboot-mode driver - Check for psci compatible in init arm,psci-1.0 - Node pointer should not be assigned in device probe. To Align on above: - Remove probe call for faux device. - Set node using device_set_node after faux_device_create. - Register the reboot mode using explicit call to psci_reboot_mode_register_device. - Updated in-code documentation. For Alignment to use of device_property_xx: power: reset: reboot-mode: Add support for 64 bit magic - Use device_property_count_u32 instead of device_property_read_u32. - Check count of properties before reading. - u64 magic changed to u32 magic[2]. - nvmem-reboot rebased on recent changes. - Update documentation and commit text. power: reset: reboot-mode: Remove devres based allocations By Dmitry/Bart: - pr_err to pr_debug in case of invalid reboot-mode prop. By Bart: - Use device_property_read_u32 instead of of_property_read_u32. - Avoid repeated code for free list. Now calling unregister from error path of regiister_reboot_mode. - Fix magic assignment. - Link to v19: https://lore.kernel.org/r/20251228-arm-psci-system_reset2-vendor-reboots-v19-0-ebb956053098@oss.qualcomm.com (local) Changes in v19: - Add missing To/Cc entries (include devicetree list) – Thanks to Krzysztof for pointing this out. - Fix compilation error in reboot-mode.c for ARCH=powerpc by explicitly including <linux/slab.h>. - Link to v18: https://lore.kernel.org/r/20251223-arm-psci-system_reset2-vendor-reboots-v18-0-32fa9e76efc3@oss.qualcomm.com (local) Changes in v18: power: reset: reboot-mode: Remove devres based allocations - Update commit text for alignment. – Bart - Read magic before assigning kzalloc(info) in reboot_mode_register. - Mukesh - Update error handling path. - Mukesh By Bjorn - Expose sysfs for reboot-mode bisected to different series- Link: https://lore.kernel.org/all/20251222-next-15nov_expose_sysfs-v21-0-244614135fd8@oss.qualcomm.com/ (local) By Bjorn/Lorenzo/Mukesh power: reset: reboot-mode: Add support for 64 bit magic - Use FIELD_GET/FIELD_PREP for u64 magic wherever required. - Update commit text and add documentation for structure of 64 bit magic. By Lorenzo - Remove direct reboot-mode registration by psci driver. - Add support for predefined reboot modes in reboot-mode framework. - Add psci-reboot-mode driver and implement a psci-resets to accommodate all psci-resets including warm, cold and customizable vendor-resets. By Bjorn - Update DT patches for qcm6490, lemans, monaco and tolos. - Update commit text to include more details – By Bjorn For Alignment - dt-bindings: arm: Document reboot mode magic - Update reboot mode documentation to clarify that argument1 should provide full value of reset_type along with the 31st bit wherever required. - DT patches for qcm6490, lemans, monaco and tolos. - Provide full value of reset_type including 31st bit.(eg:0x80000001). - Link to v17: https://lore.kernel.org/r/20251109-arm-psci-system_reset2-vendor-reboots-v17-0-46e085bca4cc@oss.qualcomm.com (local) Previous versions: - Link to v16: https://lore.kernel.org/r/20251015-arm-psci-system_reset2-vendor-reboots-v16-0-b98aedaa23ee@oss.qualcomm.com (local) - Link to v15: https://lore.kernel.org/r/20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com (local) - Link to v14: https://lore.kernel.org/r/20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com (local) - Link to v13: https://lore.kernel.org/r/20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com (local) - Link to v12: https://lore.kernel.org/r/20250721-arm-psci-system_reset2-vendor-reboots-v12-0-87bac3ec422e@oss.qualcomm.com (local) - Link to v11: https://lore.kernel.org/r/20250717-arm-psci-system_reset2-vendor-reboots-v11-0-df3e2b2183c3@oss.qualcomm.com (local) - Link to v10: https://lore.kernel.org/all/569f154d-c714-1714-b898-83a42a38771c@oss.qualcomm.com/ (local) - Link to v9: https://lore.kernel.org/all/20250303-arm-psci-system_reset2-vendor-reboots-v9-0-b2cf4a20feda@oss.qualcomm.com/ (local) - Link to v8: https://lore.kernel.org/r/20241107-arm-psci-system_reset2-vendor-reboots-v8-0-e8715fa65cb5@quicinc.com (local) - Link to v7: https://lore.kernel.org/r/20241028-arm-psci-system_reset2-vendor-reboots-v7-0-a4c40b0ebc54@quicinc.com (local) - Link to v6: https://lore.kernel.org/r/20241018-arm-psci-system_reset2-vendor-reboots-v6-0-50cbe88b0a24@quicinc.com (local) - Link to v5: https://lore.kernel.org/r/20240617-arm-psci-system_reset2-vendor-reboots-v5-0-086950f650c8@quicinc.com (local) - Link to v4: https://lore.kernel.org/r/20240611-arm-psci-system_reset2-vendor-reboots-v4-0-98f55aa74ae8@quicinc.com (local) - Link to v3: https://lore.kernel.org/r/20240515-arm-psci-system_reset2-vendor-reboots-v3-0-16dd4f9c0ab4@quicinc.com (local) - Link to v2: https://lore.kernel.org/r/20240414-arm-psci-system_reset2-vendor-reboots-v2-0-da9a055a648f@quicinc.com (local) - Link to v1: https://lore.kernel.org/r/20231117-arm-psci-system_reset2-vendor-reboots-v1-0-03c4612153e2@quicinc.com (local) - Link to RFC: https://lore.kernel.org/r/20231030-arm-psci-system_reset2-vendor-reboots-v1-0-dcdd63352ad1@quicinc.com (local) To: Lorenzo Pieralisi <lpieralisi@kernel.org> To: Arnd Bergmann <arnd@arndb.de> To: Bartosz Golaszewski <redacted> To: Bjorn Andersson <andersson@kernel.org> To: Sebastian Reichel <sre@kernel.org> To: Rob Herring <robh@kernel.org> To: Sudeep Holla <redacted> To: Souvik Chakravarty <redacted> To: Krzysztof Kozlowski <krzk+dt@kernel.org> To: Andy Yan <andy.yan@rock-chips.com> To: Matthias Brugger <matthias.bgg@gmail.com> To: Mark Rutland <mark.rutland@arm.com> To: Conor Dooley <conor+dt@kernel.org> To: Konrad Dybcio <konradybcio@kernel.org> To: John Stultz <redacted> To: Moritz Fischer <moritz.fischer@ettus.com> To: Rafael J. Wysocki <rafael@kernel.org> To: Daniel Lezcano <daniel.lezcano@kernel.org> To: Christian Loehle <christian.loehle@arm.com> To: Ulf Hansson <redacted> To: Lee Jones <lee@kernel.org> To: Ulf Hansson <ulfh@kernel.org> To: Pavan Kondeti <redacted> To: Abel Vesa <abelvesa@kernel.org> Cc: Florian Fainelli <florian.fainelli@broadcom.com> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Srinivas Kandagatla <redacted> Cc: Dmitry Baryshkov <redacted> Cc: Mukesh Ojha <redacted> Cc: Andre Draszik <andre.draszik@linaro.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Kathiravan Thirumoorthy <redacted> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: mfd@lists.linux.dev --- Shivendra Pratap (10): power: reset: reboot-mode: Support up to 3 magic values per mode power: reset: reboot-mode: Add support for predefined reboot modes firmware: psci: Introduce command-based resets firmware: psci: Add support for PSCI auxiliary devices dt-bindings: arm: Document reboot mode magic power: reset: Add psci-reboot-mode driver arm64: dts: qcom: Add psci reboot-modes for kodiak boards arm64: dts: qcom: Add psci reboot-modes for lemans boards arm64: dts: qcom: Add psci reboot-modes for monaco boards arm64: dts: qcom: Add psci reboot-modes for talos boards Documentation/devicetree/bindings/arm/psci.yaml | 60 +++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/qcom/kodiak.dtsi | 2 +- arch/arm64/boot/dts/qcom/lemans-evk.dts | 7 + arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 7 + arch/arm64/boot/dts/qcom/lemans.dtsi | 2 +- arch/arm64/boot/dts/qcom/monaco-evk.dts | 7 + arch/arm64/boot/dts/qcom/monaco.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 7 + arch/arm64/boot/dts/qcom/qcs615-ride.dts | 7 + arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 7 + arch/arm64/boot/dts/qcom/qcs8300-ride.dts | 7 + arch/arm64/boot/dts/qcom/talos.dtsi | 2 +- drivers/cpuidle/Kconfig.arm | 1 + drivers/cpuidle/cpuidle-psci-domain.c | 31 ++-- drivers/firmware/psci/Kconfig | 14 ++ drivers/firmware/psci/Makefile | 1 + drivers/firmware/psci/psci-devices.c | 108 ++++++++++++ drivers/firmware/psci/psci.c | 117 ++++++++++++- drivers/power/reset/Kconfig | 10 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/nvmem-reboot-mode.c | 7 +- drivers/power/reset/psci-reboot-mode.c | 104 ++++++++++++ drivers/power/reset/qcom-pon.c | 7 +- drivers/power/reset/reboot-mode.c | 208 +++++++++++++++++------ drivers/power/reset/syscon-reboot-mode.c | 7 +- include/linux/psci.h | 15 ++ include/linux/reboot-mode.h | 27 +++ 28 files changed, 696 insertions(+), 81 deletions(-) --- base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a change-id: 20250709-arm-psci-system_reset2-vendor-reboots-46c80044afcf Best regards, -- Shivendra Pratap [off-list ref]