qcom: EFI PSCI runtime reset handling and config update
v3 cover qcom: EFI PSCI runtime reset handling and config update
This series refactors the EFI runtime PSCI reset handling:
1. Introduce EFI_PSCI_RESET_RUNTIME config to control PSCI-based EFI reset logic in U-Boot. This allows platforms to disable U-Boot’s runtime reset handling when the kernel needs to manage specialized reboot modes.
2. Enabled CONFIG_EFI_PSCI_RESET_RUNTIME by default in Kconfig as per the discussion in this thread [1]
2. Disable CONFIG_EFI_PSCI_RESET_RUNTIME in qcom_defconfig so that the kernel retains full control over reset modes (e.g., EDL, bootloader), ensuring correct behavior for advanced reboot requests.
[1] https://lore.kernel.org/all/20260108143742.GT3416603@bill-the-cat/
---
Changes in v3:
- Updated the commit message
- Changed 'CONFIG_EFI_PSCI_RESET_RUNTIME=n' to '# CONFIG_EFI_PSCI_RESET_RUNTIME is not set'
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- As per review comments made default y for EFI_PSCI_RESET_RUNTIME config
- Disabled the EFI_PSCI_RESET_RUNTIME config for qualcomm platforms
- Link to v1: https://lore.kernel.org/all/[email protected]/
---
Aswin Murugan (2):
firmware: psci: Refactor EFI runtime PSCI reset handling
qcom_defconfig: Disable CONFIG_EFI_PSCI_RESET_RUNTIME
configs/qcom_defconfig | 1 + drivers/firmware/psci.c | 4 ++-- lib/efi_loader/Kconfig | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
PATCH v3 1/2 firmware: psci: Refactor EFI runtime PSCI reset handling
The current PSCI-based EFI runtime reset implementation is always enabled when CONFIG_PSCI_RESET is set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.
Add CONFIG_EFI_PSCI_RESET_RUNTIME to give platforms explicit control over the PSCI-specific EFI runtime reset path. This allows a platform to disable U-Boot's PSCI reset handler when needed so that the kernel can perform the reset with the correct arguments for special reboot modes.
The option defaults to enabled to maintain backward compatibility with the existing behavior.
---
Changes in v3:
- Commit message has been updated, no change in code
Changes in v2:
- As per review comments made default y for EFI_PSCI_RESET_RUNTIME config
--- drivers/firmware/psci.c | 4 ++-- lib/efi_loader/Kconfig | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/firmware/psci.c +2 -2
@@ -244,7 +244,7 @@ static void __maybe_unused do_psci_probe(void)uclass_get_device_by_name (UCLASS_FIRMWARE ,DRIVER_NAME , &dev); } -#if IS_ENABLED (CONFIG_EFI_LOADER ) &&IS_ENABLED (CONFIG_PSCI_RESET ) +#if IS_ENABLED (CONFIG_EFI_PSCI_RESET_RUNTIME )efi_status_t efi_reset_system_init (void ) {do_psci_probe ();
@@ -266,7 +266,7 @@ void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type,while (1 ) ; } -#endif /* IS_ENABLED(CONFIG_EFI_LOADER) && IS_ENABLED(CONFIG_PSCI_RESET) */ +#endif /* IS_ENABLED(CONFIG_EFI_PSCI_RESET_RUNTIME) */ #ifdef CONFIG_PSCI_RESET void reset_misc (void )
lib/efi_loader/Kconfig +8 -0
@@ -106,6 +106,14 @@ config EFI_HAVE_RUNTIME_RESET depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ SANDBOX || SYSRESET_SBI || SYSRESET_X86 +config EFI_PSCI_RESET_RUNTIME + bool "EFI Runtime PSCI Reset Support" + default y if EFI_LOADER && PSCI_RESET + depends on ARM_PSCI_FW + help + Enable PSCI-based reset implementation for EFI runtime services. + This allows the OS to reset the system through EFI runtime calls. + endmenu menu "UEFI Variables"
Signature · 1 line
2.34.1
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
Hi Ashwin
Quoted 7 lines · Aswin Murugan
The current PSCI-based EFI runtime reset implementation is always enabled when
CONFIG_PSCI_RESETis set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.Add
CONFIG_EFI_PSCI_RESET_RUNTIMEto give platforms explicit control over
Is there anything missing and you can't use EFI_HAVE_RUNTIME_RESET?
Quoted 33 lines
the PSCI-specific EFI runtime reset path. This allows a platform to disable U-Boot's PSCI reset handler when needed so that the kernel can perform the reset with the correct arguments for special reboot modes.
The option defaults to enabled to maintain backward compatibility with the existing behavior.
Signed-off-by Aswin Murugan <[email protected]>---
Changes in v3:
- Commit message has been updated, no change in codeChanges in v2:
- As per review comments made default y forEFI_PSCI_RESET_RUNTIMEconfig--- drivers/firmware/psci.c | 4 ++-- lib/efi_loader/Kconfig | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)drivers/firmware/psci.c +1
-1@@ -244,7 +244,7 @@ static void __maybe_unused do_psci_probe(void)uclass_get_device_by_name (UCLASS_FIRMWARE ,DRIVER_NAME , &dev); } -#if IS_ENABLED (CONFIG_EFI_LOADER ) &&IS_ENABLED (CONFIG_PSCI_RESET ) +#if IS_ENABLED (CONFIG_EFI_PSCI_RESET_RUNTIME )efi_status_t efi_reset_system_init (void ) {do_psci_probe ();
drivers/firmware/psci.c void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type, · line 269
Quoted 5 lines
drivers/firmware/psci.c +1
-1@@ -266,7 +266,7 @@ void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type,while (1 ) ; } -#endif /* IS_ENABLED(CONFIG_EFI_LOADER) && IS_ENABLED(CONFIG_PSCI_RESET) */ +#endif /* IS_ENABLED(CONFIG_EFI_PSCI_RESET_RUNTIME) */
You also have to adjust the RT config table in lib/efi_loader/efi_runtime.c, but I really think we should reuse EFI_HAVE_RUNTIME_RESET
Cheers
/Ilias
Quoted 25 lines
drivers/firmware/psci.c +0
-0#ifdef CONFIG_PSCI_RESET void reset_misc (void )lib/efi_loader/Kconfig +8
-1@@ -106,6 +106,14 @@ config EFI_HAVE_RUNTIME_RESET depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ SANDBOX || SYSRESET_SBI || SYSRESET_X86 +config EFI_PSCI_RESET_RUNTIME + bool "EFI Runtime PSCI Reset Support" + default y if EFI_LOADER && PSCI_RESET + depends on ARM_PSCI_FW + help + Enable PSCI-based reset implementation for EFI runtime services. + This allows the OS to reset the system through EFI runtime calls. + endmenu menu "UEFI Variables" --2.34.1
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
Quoted 11 lines · Ilias Apalodimas
Hi Ashwin
Quoted 6 lines · Aswin Murugan
The current PSCI-based EFI runtime reset implementation is always enabled when
CONFIG_PSCI_RESETis set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.Add
CONFIG_EFI_PSCI_RESET_RUNTIMEto give platforms explicit control overIs there anything missing and you can't use
EFI_HAVE_RUNTIME_RESET?
Thanks for the feedback, Ilias
This is a kernel‑level limitation based on drivers/firmware/efi/reboot.c [1] implementation in Linux. The efi_reboot function intentionally ignores the reboot data string and always passes NULL to ResetSystem. As a result, special reboot modes like "bootloader" or "recovery" aren’t forwarded through EFI_HAVE_RUNTIME_RESET.
Quoted 28 lines
Quoted 28 lines
the PSCI-specific EFI runtime reset path. This allows a platform to disable U-Boot's PSCI reset handler when needed so that the kernel can perform the reset with the correct arguments for special reboot modes.
The option defaults to enabled to maintain backward compatibility with the existing behavior.
Signed-off-by Aswin Murugan <[email protected]>---
Changes in v3:
- Commit message has been updated, no change in codeChanges in v2:
- As per review comments made default y forEFI_PSCI_RESET_RUNTIMEconfig--- drivers/firmware/psci.c | 4 ++-- lib/efi_loader/Kconfig | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)drivers/firmware/psci.c +0
-0@@ -244,7 +244,7 @@ static void __maybe_unused do_psci_probe(void)uclass_get_device_by_name (UCLASS_FIRMWARE ,DRIVER_NAME , &dev); }
Quoted 14 lines
drivers/firmware/psci.c void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type, · line 269
Quoted 11 lines
drivers/firmware/psci.c +2
-2-#if IS_ENABLED (CONFIG_EFI_LOADER ) &&IS_ENABLED (CONFIG_PSCI_RESET ) +#if IS_ENABLED (CONFIG_EFI_PSCI_RESET_RUNTIME )efi_status_t efi_reset_system_init (void ) {do_psci_probe ();@@ -266,7 +266,7 @@ void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type,while (1 ) ; } -#endif /* IS_ENABLED(CONFIG_EFI_LOADER) && IS_ENABLED(CONFIG_PSCI_RESET) */ +#endif /* IS_ENABLED(CONFIG_EFI_PSCI_RESET_RUNTIME) */ You also have to adjust the RT config table in
lib/efi_loader/efi_runtime.c, but I really think we should reuseEFI_HAVE_RUNTIME_RESET
EFI_HAVE_RUNTIME_RESET is enabled by default & depends on PSCI_RESET config,
So even if i disabled EFI_HAVE_RUNTIME_RESET on defconfig it was overridden, since PSCI_RESET is enabled it was auto enabling it, hence introduced a new config CONFIG_EFI_PSCI_RESET_RUNTIME to control psci based EFI runtime reset control.
Thanks,
Aswin
Quoted 27 lines
Cheers
/IliasQuoted 24 lines
drivers/firmware/psci.c +0
-0#ifdef CONFIG_PSCI_RESET void reset_misc (void )lib/efi_loader/Kconfig +8
-1@@ -106,6 +106,14 @@ config EFI_HAVE_RUNTIME_RESET depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ SANDBOX || SYSRESET_SBI || SYSRESET_X86 +config EFI_PSCI_RESET_RUNTIME + bool "EFI Runtime PSCI Reset Support" + default y if EFI_LOADER && PSCI_RESET + depends on ARM_PSCI_FW + help + Enable PSCI-based reset implementation for EFI runtime services. + This allows the OS to reset the system through EFI runtime calls. + endmenu menu "UEFI Variables" --2.34.1
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
[...]
Quoted 29 lines
Quoted 15 lines
Quoted 15 lines
Changes in v2:
- As per review comments made default y forEFI_PSCI_RESET_RUNTIMEconfig--- drivers/firmware/psci.c | 4 ++-- lib/efi_loader/Kconfig | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)drivers/firmware/psci.c +0
-0@@ -244,7 +244,7 @@ static void __maybe_unused do_psci_probe(void)uclass_get_device_by_name (UCLASS_FIRMWARE ,DRIVER_NAME , &dev); }Quoted 14 lines
drivers/firmware/psci.c void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type, · line 269
Quoted 11 lines
drivers/firmware/psci.c +2
-2-#if IS_ENABLED (CONFIG_EFI_LOADER ) &&IS_ENABLED (CONFIG_PSCI_RESET ) +#if IS_ENABLED (CONFIG_EFI_PSCI_RESET_RUNTIME )efi_status_t efi_reset_system_init (void ) {do_psci_probe ();@@ -266,7 +266,7 @@ void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type,while (1 ) ; } -#endif /* IS_ENABLED(CONFIG_EFI_LOADER) && IS_ENABLED(CONFIG_PSCI_RESET) */ +#endif /* IS_ENABLED(CONFIG_EFI_PSCI_RESET_RUNTIME) */ You also have to adjust the RT config table in
lib/efi_loader/efi_runtime.c, but I really think we should reuseEFI_HAVE_RUNTIME_RESET
Quoted 5 lines
EFI_HAVE_RUNTIME_RESETis enabled by default & depends onPSCI_RESETconfig, So even if i disabledEFI_HAVE_RUNTIME_RESETon defconfig it was overridden, sincePSCI_RESETis enabled it was auto enabling it, hence introduced a new configCONFIG_EFI_PSCI_RESET_RUNTIMEto control psci based EFI runtime reset control.
That's something we should change then. Having PSCI enabled doesn't automatically mean you can have a runtime service for it. Also this patch seems incorrect, since the EFI RT config table still claims it support runtime resets, but it only uses the default function.
In your setup should the firmware claim it supports runtime resets?
Thanks
/Ilias
Quoted 30 lines
Thanks,
AswinQuoted 27 lines
Cheers
/IliasQuoted 24 lines
drivers/firmware/psci.c +0
-0#ifdef CONFIG_PSCI_RESET void reset_misc (void )lib/efi_loader/Kconfig +8
-1@@ -106,6 +106,14 @@ config EFI_HAVE_RUNTIME_RESET depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ SANDBOX || SYSRESET_SBI || SYSRESET_X86 +config EFI_PSCI_RESET_RUNTIME + bool "EFI Runtime PSCI Reset Support" + default y if EFI_LOADER && PSCI_RESET + depends on ARM_PSCI_FW + help + Enable PSCI-based reset implementation for EFI runtime services. + This allows the OS to reset the system through EFI runtime calls. + endmenu menu "UEFI Variables" --2.34.1
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
In reply to Aswin MuruganQuoted 13 lines · Aswin Murugan
Quoted 11 lines · Ilias Apalodimas
Hi Ashwin
Quoted 6 lines · Aswin Murugan
The current PSCI-based EFI runtime reset implementation is always enabled when
CONFIG_PSCI_RESETis set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.Add
CONFIG_EFI_PSCI_RESET_RUNTIMEto give platforms explicit control overIs there anything missing and you can't use
EFI_HAVE_RUNTIME_RESET?
Quoted 9 lines
Thanks for the feedback, Ilias
This is a kernel‑level limitation based ondrivers/firmware/efi/reboot.c[1] implementation in Linux. Theefi_rebootfunction intentionally ignores the reboot data string and always passes NULL to ResetSystem. As a result, special reboot modes like "bootloader" or "recovery" aren’t forwarded throughEFI_HAVE_RUNTIME_RESET.
Yeah I know about that limitation for which the right EFI approach to use is EFI_RESET_PLATFORM_SPECIFIC. I tried to implement it here [1] but looks like needs a bit more testing from UEFI implementations. Would you be able to give that approach a try?
Having EFI runtime reset service exposed to OS is certainely better than OS trying to rely on platform/PSCI specific reset approaches.
[1] https://lore.kernel.org/all/[email protected]/
-Sumit
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
In reply to Aswin MuruganAm 13. Februar 2026 12:05:26 MEZ schrieb Aswin Murugan <[email protected]>:
Quoted 4 lines
The current PSCI-based EFI runtime reset implementation is always enabled when
CONFIG_PSCI_RESETis set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.
Are the "specialized" reset modes defined in the PSCI specification or at least compliant to it? Where can I find the description of these reset modes.
If you don't want to use U-Boot's PSCI implementation, why don't you simply disable the PSCI driver?
Quoted 62 lines
Add
CONFIG_EFI_PSCI_RESET_RUNTIMEto give platforms explicit control over the PSCI-specific EFI runtime reset path. This allows a platform to disable U-Boot's PSCI reset handler when needed so that the kernel can perform the reset with the correct arguments for special reboot modes.The option defaults to enabled to maintain backward compatibility with the existing behavior.
Signed-off-by Aswin Murugan <[email protected]>---
Changes in v3:
- Commit message has been updated, no change in codeChanges in v2:
- As per review comments made default y forEFI_PSCI_RESET_RUNTIMEconfig
---drivers/firmware/psci.c| 4 ++--lib/efi_loader/Kconfig| 8 ++++++++2 files changed, 10 insertions(+), 2 deletions(-)drivers/firmware/psci.c +2
-2@@ -244,7 +244,7 @@ static void __maybe_unused do_psci_probe(void)uclass_get_device_by_name (UCLASS_FIRMWARE ,DRIVER_NAME , &dev); } -#if IS_ENABLED (CONFIG_EFI_LOADER ) &&IS_ENABLED (CONFIG_PSCI_RESET ) +#if IS_ENABLED (CONFIG_EFI_PSCI_RESET_RUNTIME )efi_status_t efi_reset_system_init (void ) {do_psci_probe ();@@ -266,7 +266,7 @@ void __efi_runtime EFIAPI efi_reset_system(enum efi_reset_type reset_type,while (1 ) ; } -#endif /* IS_ENABLED(CONFIG_EFI_LOADER) && IS_ENABLED(CONFIG_PSCI_RESET) */ +#endif /* IS_ENABLED(CONFIG_EFI_PSCI_RESET_RUNTIME) */ #ifdef CONFIG_PSCI_RESET void reset_misc (void )lib/efi_loader/Kconfig +8
-0@@ -106,6 +106,14 @@ config EFI_HAVE_RUNTIME_RESET depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ SANDBOX || SYSRESET_SBI || SYSRESET_X86 +config EFI_PSCI_RESET_RUNTIME + bool "EFI Runtime PSCI Reset Support" + default y if EFI_LOADER && PSCI_RESET + depends on ARM_PSCI_FW + help + Enable PSCI-based reset implementation for EFI runtime services. + This allows the OS to reset the system through EFI runtime calls. +endmenu
menu "UEFI Variables"
Re: [PATCH v3 1/2] firmware: psci: Refactor EFI runtime PSCI reset handling
Quoted 6 lines · Heinrich Schuchardt
Am 13. Februar 2026 12:05:26 MEZ schrieb Aswin Murugan <[email protected]>:
Quoted 4 lines
The current PSCI-based EFI runtime reset implementation is always enabled when
CONFIG_PSCI_RESETis set, but it does not support the extra arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode are ignored and fall back to a normal reboot.Are the "specialized" reset modes defined in the PSCI specification or at least compliant to it? Where can I find the description of these reset modes.
The specialized reset modes are not defined as standard PSCI reset modes, but they are supported through the *PSCI SYSTEM_RESET2* call [1], which is explicitly designed for vendor‑specific reset types. SYSTEM_RESET2 takes two parameters reset_type and cookie. Together, these parameters enable platform firmware to handle specialized reset behaviors modes such as bootloader, recovery, EDL, and others that are defined by the SoC vendor.
Quoted 1 line
If you don't want to use U-Boot's PSCI implementation, why don't you simply disable the PSCI driver?
We still rely on the PSCI‑based reset flow in U‑Boot for normal functionality, so disabling the PSCI driver entirely would not be suitable for us. Our intention is only to avoid invoking the PSCI reset path specifically during EFI runtime reboot requests, since those are handled differently. Outside of the EFI runtime reboot case, U‑Boot should continue to use its PSCI implementation as usual. [1] https://developer.arm.com/documentation/den0022/fb/?lang=en Thanks, Aswin
PATCH v3 2/2 qcom_defconfig: Disable CONFIG_EFI_PSCI_RESET_RUNTIME
In reply to Aswin MuruganDisable CONFIG_EFI_PSCI_RESET_RUNTIME in qcom_defconfig to let the kernel manage reset modes and handle specialized reboot requests correctly.
---
Changes in v3:
- Changed 'CONFIG_EFI_PSCI_RESET_RUNTIME=n' to '# CONFIG_EFI_PSCI_RESET_RUNTIME is not set'
--- configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/qcom_defconfig +1 -0
@@ -6,6 +6,7 @@ CONFIG_ARCH_SNAPDRAGON=y CONFIG_NR_DRAM_BANKS=24 CONFIG_DEFAULT_DEVICE_TREE="qcom/sdm845-db845c" CONFIG_SYS_LOAD_ADDR=0xA0000000 +# CONFIG_EFI_PSCI_RESET_RUNTIME is not set CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
Signature · 1 line
2.34.1