Skip to content

Commit e688c22

Browse files
shankerwangmiaochenhuacai
authored andcommitted
LoongArch: Enable general EFI poweroff method
efi_shutdown_init() can register a general sys_off handler named efi_power_off(). Enable this by providing efi_poweroff_required(), like arm and x86. Since EFI poweroff is also supported on LoongArch, and the enablement makes the poweroff function usable for hardwares which lack ACPI S5. We prefer ACPI poweroff rather than EFI poweroff (like x86), so we only require EFI poweroff if acpi_gbl_reduced_hardware or acpi_no_s5 is true. Cc: stable@vger.kernel.org Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent de9c2c6 commit e688c22

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • arch/loongarch/kernel

arch/loongarch/kernel/efi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ void __init efi_runtime_init(void)
6666
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
6767
}
6868

69+
bool efi_poweroff_required(void)
70+
{
71+
return efi_enabled(EFI_RUNTIME_SERVICES) &&
72+
(acpi_gbl_reduced_hardware || acpi_no_s5);
73+
}
74+
6975
unsigned long __initdata screen_info_table = EFI_INVALID_TABLE_ADDR;
7076

7177
#if defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON)

0 commit comments

Comments
 (0)