linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] ACPICA: Enable sleep button on ACPI legacy wake
@ 2020-01-15 23:26 Anchal Agarwal
  2020-01-16  9:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Anchal Agarwal @ 2020-01-15 23:26 UTC (permalink / raw)
  To: robert.moore, rafael.j.wysocki, linux-acpi, linux-kernel, lenb,
	devel, erik.kaneda, sblbir, fllinden, anchalag

Currently we do not see sleep_enable bit set after guest resumes
from hibernation. Hibernation is triggered in guest on receiving
a sleep trigger from the hypervisor(S4 state). We see that power
button is enabled on wake up from S4 state however sleep button
isn't. This causes subsequent invocation of sleep state to fail
in the guest. Any environment  going through acpi_hw_legacy_wake()
won't have sleep button enabled.

Signed-off-by: Anchal Agarwal <anchalag@amazon.com>
Reviewed-by: Balbir Singh <sblbir@amazon.com>
Reviewed-by: Frank van der Linden <fllinden@amazon.com>
---
 drivers/acpi/acpica/hwsleep.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index b62db8ec446f..a176c7802760 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -300,6 +300,17 @@ 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);
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-22 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 23:26 [RESEND PATCH] ACPICA: Enable sleep button on ACPI legacy wake Anchal Agarwal
2020-01-16  9:40 ` Rafael J. Wysocki
2020-01-22 19:12   ` Kaneda, Erik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).