Skip to content

Commit f198478

Browse files
superm1rafaeljw
authored andcommitted
ACPI: x86: s2idle: Adjust Microsoft LPS0 _DSM handling sequence
In Windows the Microsoft _DSM doesn't call functions 3->5->7 for suspend and 8->6->4 for resume like Linux currently does. Rather it calls 3->7->5 for suspend and 6->8->4 for resume. Align this calling order for Linux as well. Link: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-states Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 89d5b71 commit f198478

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/acpi/x86/s2idle.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,11 @@ int acpi_s2idle_prepare_late(void)
485485
ACPI_LPS0_ENTRY,
486486
lps0_dsm_func_mask, lps0_dsm_guid);
487487
if (lps0_dsm_func_mask_microsoft > 0) {
488-
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY,
489-
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
490488
/* modern standby entry */
491489
acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_ENTRY,
492490
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
491+
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY,
492+
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
493493
}
494494

495495
list_for_each_entry(handler, &lps0_s2idle_devops_head, list_node) {
@@ -524,11 +524,6 @@ void acpi_s2idle_restore_early(void)
524524
if (handler->restore)
525525
handler->restore();
526526

527-
/* Modern standby exit */
528-
if (lps0_dsm_func_mask_microsoft > 0)
529-
acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
530-
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
531-
532527
/* LPS0 exit */
533528
if (lps0_dsm_func_mask > 0)
534529
acpi_sleep_run_lps0_dsm(acpi_s2idle_vendor_amd() ?
@@ -539,6 +534,11 @@ void acpi_s2idle_restore_early(void)
539534
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT,
540535
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
541536

537+
/* Modern standby exit */
538+
if (lps0_dsm_func_mask_microsoft > 0)
539+
acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
540+
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
541+
542542
/* Screen on */
543543
if (lps0_dsm_func_mask_microsoft > 0)
544544
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON,

0 commit comments

Comments
 (0)