Applied with small modifications, thanks. Huacai On Wed, Aug 7, 2024 at 1:45 PM Miao Wang via B4 Relay <devnull+shankerwangmiao.gmail.com@xxxxxxxxxx> wrote: > > From: Miao Wang <shankerwangmiao@xxxxxxxxx> > > efi_shutdown_init can register a general sys_off handler, > efi_power_off. Enable this by providing efi_poweroff_required, > like arm and x86, since this is also supported on loongarch. > > Signed-off-by: Miao Wang <shankerwangmiao@xxxxxxxxx> > --- > arch/loongarch/kernel/efi.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/loongarch/kernel/efi.c b/arch/loongarch/kernel/efi.c > index 000825406c1f..df57c2674758 100644 > --- a/arch/loongarch/kernel/efi.c > +++ b/arch/loongarch/kernel/efi.c > @@ -73,6 +73,11 @@ struct screen_info screen_info __section(".data"); > EXPORT_SYMBOL_GPL(screen_info); > #endif > > +bool efi_poweroff_required(void) > +{ > + return efi_enabled(EFI_RUNTIME_SERVICES); > +} > + > static void __init init_screen_info(void) > { > struct screen_info *si; > -- > 2.43.0 > > >