Commit 9b42f76a authored by Ard Biesheuvel's avatar Ard Biesheuvel
Browse files

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: default avatarArd Biesheuvel <ardb@kernel.org>
parent 69f4cab1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ void efi_reboot(enum reboot_mode reboot_mode, const char *__unused)
	const char *str[] = { "cold", "warm", "shutdown", "platform" };
	int efi_mode, cap_reset_mode;

	if (!efi_enabled(EFI_RUNTIME_SERVICES))
	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_RESET_SYSTEM))
		return;

	switch (reboot_mode) {
@@ -64,7 +64,7 @@ static void efi_power_off(void)

static int __init efi_shutdown_init(void)
{
	if (!efi_enabled(EFI_RUNTIME_SERVICES))
	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_RESET_SYSTEM))
		return -ENODEV;

	if (efi_poweroff_required()) {