aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-07-08 15:14:12 +0200
committerHans de Goede <hdegoede@redhat.com>2022-07-10 17:41:06 +0200
commitd40908f2621ea7abc6132ec8c5688a2960eeee3c (patch)
tree09ea31ff7ce53f5238fcd2a9340f6590c4c41ce2 /drivers/platform/x86
parentplatform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again (diff)
downloadlinux-dev-d40908f2621ea7abc6132ec8c5688a2960eeee3c.tar.xz
linux-dev-d40908f2621ea7abc6132ec8c5688a2960eeee3c.zip
efi: Fix efi_power_off() not being run before acpi_power_off() when necessary
Commit 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") switched the ACPI sleep code from directly setting the old global pm_power_off handler to using the new register_sys_off_handler() mechanism with a priority of SYS_OFF_PRIO_FIRMWARE. This is a problem when the old global pm_power_off handler would later be overwritten, such as done by the late_initcall(efi_shutdown_init): if (efi_poweroff_required()) pm_power_off = efi_power_off; The old global pm_power_off handler gets run with a priority of SYS_OFF_PRIO_DEFAULT which is lower then SYS_OFF_PRIO_FIRMWARE, causing acpi_power_off() to run first, changing the behavior from before the ACPI sleep code switched to the new register_sys_off_handler(). Switch the registering of efi_power_off over to register_sys_off_handler() with a priority of SYS_OFF_PRIO_FIRMWARE + 1 so that it will run before acpi_power_off() as before. Note since the new sys-off-handler code will try all handlers in priority order, there is no more need for the EFI code to store and call the original pm_power_off handler. Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20220708131412.81078-3-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86')
0 files changed, 0 insertions, 0 deletions