[PATCH 04/10] ACPICA: Enable sleep button on ACPI legacy wake

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Anchal Agarwal <anchalag@xxxxxxxxxx>

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 <anchalag@xxxxxxxxxx>
Reviewed-by: Balbir Singh <sblbir@xxxxxxxxxx>
Reviewed-by: Frank van der Linden <fllinden@xxxxxxxxxx>
[ ek: changelog]

Link: https://github.com/acpica/acpica/commit/9383f5b0
Signed-off-by: Erik Kaneda <erik.kaneda@xxxxxxxxx>
Signed-off-by: Anchal Agarwal <anchalag@xxxxxxxxxx>
Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>
---
 drivers/acpi/acpica/hwsleep.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 243a25add28f..317ae870336b 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -300,6 +300,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 				    [ACPI_EVENT_POWER_BUTTON].
 				    status_register_id, ACPI_CLEAR_STATUS);
 
+	/* Enable sleep button */
+
+	(void)
+	    acpi_write_bit_register(acpi_gbl_fixed_event_info
+				    [ACPI_EVENT_SLEEP_BUTTON].
+				    enable_register_id, ACPI_ENABLE_EVENT);
+
+	(void)
+	    acpi_write_bit_register(acpi_gbl_fixed_event_info
+				    [ACPI_EVENT_SLEEP_BUTTON].
+				    status_register_id, ACPI_CLEAR_STATUS);
+
 	acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
 	return_ACPI_STATUS(status);
 }
-- 
2.21.0




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux