Skip to content

Commit 860c024

Browse files
shankerwangmiaoMingcongBai
authored andcommitted
loongarch/reset: use general efi poweroff
Currently efi_shutdown_init can register a general sys_off handler, efi_power_off, which will be called during do_kernel_power_off and shut the machine off via efi runtime services. So enable this by providing efi_poweroff_required, like arm and x86, and prevent directly calling efi.reset_system in machine_power_off. Signed-off-by: Miao Wang <[email protected]>
1 parent 658b88a commit 860c024

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/loongarch/kernel/efi.c

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ void __init efi_runtime_init(void)
7171

7272
unsigned long __initdata screen_info_table = EFI_INVALID_TABLE_ADDR;
7373

74+
bool efi_poweroff_required(void)
75+
{
76+
return efi_enabled(EFI_RUNTIME_SERVICES);
77+
}
78+
7479
static void __init init_screen_info(void)
7580
{
7681
struct screen_info *si;

arch/loongarch/kernel/reset.c

-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ void machine_power_off(void)
4848
enable_pci_wakeup();
4949
#endif
5050
do_kernel_power_off();
51-
#ifdef CONFIG_EFI
52-
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
53-
#endif
5451

5552
while (true) {
5653
__arch_cpu_idle();

0 commit comments

Comments
 (0)