From: Matthew Garrett Date: Wed, 6 Aug 2008 18:12:04 +0000 (+0100) Subject: ACPI: Clear WAK_STS on resume X-Git-Tag: v2.6.28-rc1~26^2~12^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a68823ee5285e65b51ceb96f8b13a5b4f99a6888;p=linux-2.6-omap-h63xx.git ACPI: Clear WAK_STS on resume The leading other brand OS appears to clear the WAK_STS flag on resume. When rebooted, certain BIOSes assume that the system is actually resuming if it's still set and so fail to reboot correctly. Make sure that it's cleared at resume time. Comment clarified as suggested by Bob Moore http://bugzilla.kernel.org/show_bug.cgi?id=11634 Signed-off-by: Matthew Garrett Signed-off-by: Andi Kleen Tested-by: Christian Borntraeger Tested-by: Romano Giannetti Signed-off-by: Len Brown --- diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index dba3cfbe8cb..130a44b7968 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c @@ -627,6 +627,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) } /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ + /* + * Some BIOSes assume that WAK_STS will be cleared on resume and use + * it to determine whether the system is rebooting or resuming. Clear + * it for compatibility. + */ + acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1); + acpi_gbl_system_awake_and_running = TRUE; /* Enable power button */