Commit 60c0d45a authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas
Browse files

efi/arm64: use UEFI for system reset and poweroff

If UEFI Runtime Services are available, they are preferred over direct
PSCI calls or other methods to reset the system.

For the reset case, we need to hook into machine_restart(), as the
arm_pm_restart function pointer may be overwritten by modules.

Tested-by: Mark Rutland's avatarMark Rutland <>
Reviewed-by: Mark Rutland's avatarMark Rutland <>
Reviewed-by: default avatarMatt Fleming <>
Signed-off-by: default avatarArd Biesheuvel <>
Signed-off-by: Catalin Marinas's avatarCatalin Marinas <>
parent 285994a6
......@@ -354,3 +354,12 @@ void efi_virtmap_unload(void)
* UpdateCapsule() depends on the system being shutdown via
* ResetSystem().
bool efi_poweroff_required(void)
return efi_enabled(EFI_RUNTIME_SERVICES);
......@@ -21,6 +21,7 @@
#include <stdarg.h>
#include <linux/compat.h>
#include <linux/efi.h>
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -150,6 +151,13 @@ void machine_restart(char *cmd)
* UpdateCapsule() depends on the system being reset via
* ResetSystem().
if (efi_enabled(EFI_RUNTIME_SERVICES))
efi_reboot(reboot_mode, NULL);
/* Now call the architecture specific reboot code. */
if (arm_pm_restart)
arm_pm_restart(reboot_mode, cmd);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment