Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi: Use EFI ResetSystem only when available

Do not attempt to call EFI ResetSystem if the runtime supported mask tells
us it is no longer functional at OS runtime.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

+2 -2
+2 -2
drivers/firmware/efi/reboot.c
··· 15 15 const char *str[] = { "cold", "warm", "shutdown", "platform" }; 16 16 int efi_mode, cap_reset_mode; 17 17 18 - if (!efi_enabled(EFI_RUNTIME_SERVICES)) 18 + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_RESET_SYSTEM)) 19 19 return; 20 20 21 21 switch (reboot_mode) { ··· 64 64 65 65 static int __init efi_shutdown_init(void) 66 66 { 67 - if (!efi_enabled(EFI_RUNTIME_SERVICES)) 67 + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_RESET_SYSTEM)) 68 68 return -ENODEV; 69 69 70 70 if (efi_poweroff_required()) {