]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - arch/x86/kernel/tboot.c
x86, acpi, tboot: Have a ACPI os prepare sleep instead of calling tboot_sleep.
[mirror_ubuntu-hirsute-kernel.git] / arch / x86 / kernel / tboot.c
index e2410e27f97ef94d7b87d8338b61f5b7bb87611e..1a4ab7df5b63310e117460aca98addcb84f467dd 100644 (file)
@@ -297,6 +297,12 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
 
        tboot_shutdown(acpi_shutdown_map[sleep_state]);
 }
+static int tboot_sleep_wrapper(u8 sleep_state, u32 pm1a_control,
+                              u32 pm1b_control)
+{
+       tboot_sleep(sleep_state, pm1a_control, pm1b_control);
+       return 0;
+}
 
 static atomic_t ap_wfs_count;
 
@@ -345,6 +351,8 @@ static __init int tboot_late_init(void)
 
        atomic_set(&ap_wfs_count, 0);
        register_hotcpu_notifier(&tboot_cpu_notifier);
+
+       acpi_os_set_prepare_sleep(&tboot_sleep_wrapper);
        return 0;
 }