Skip to content

Commit a1dc35b

Browse files
anchalagrafaeljw
authored andcommitted
ACPICA: Enable sleep button on ACPI legacy wake
ACPICA commit 9383f5b01091e432c05f802a57edc20d329eec1f Hibernation (S4) is triggered in a guest when it recieves a sleep trigger from the hypervisor. When the guest resumes from this power state, it does not see the sleep_enabled bit. In otherwords, the sleep button is not enabled on waking from an S4 state. This causes subsequent invocation of sleep state to fail in the guest. Fix this problem by enabling the sleep button in ACPI legacy wake. Signed-off-by: Anchal Agarwal <[email protected]> Reviewed-by: Balbir Singh <[email protected]> Reviewed-by: Frank van der Linden <[email protected]> [ ek: changelog] Link: acpica/acpica@9383f5b0 Signed-off-by: Erik Kaneda <[email protected]> Signed-off-by: Anchal Agarwal <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4444b17 commit a1dc35b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/acpi/acpica/hwsleep.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
300300
[ACPI_EVENT_POWER_BUTTON].
301301
status_register_id, ACPI_CLEAR_STATUS);
302302

303+
/* Enable sleep button */
304+
305+
(void)
306+
acpi_write_bit_register(acpi_gbl_fixed_event_info
307+
[ACPI_EVENT_SLEEP_BUTTON].
308+
enable_register_id, ACPI_ENABLE_EVENT);
309+
310+
(void)
311+
acpi_write_bit_register(acpi_gbl_fixed_event_info
312+
[ACPI_EVENT_SLEEP_BUTTON].
313+
status_register_id, ACPI_CLEAR_STATUS);
314+
303315
acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
304316
return_ACPI_STATUS(status);
305317
}

0 commit comments

Comments
 (0)