Skip to contentSkip to conversation

Clear WAK_STS on resume

PATCH In review Matthew Garrett 4 participants 5 messages Aug 6, 2008 – Aug 11, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

I've had it confirmed by AMI that some of their BIOSes make this assumption - there may well be others out there as well.

drivers/acpi/hardware/hwsleep.c +3 -0
index dba3cfb..1cda856 100644
@@ -627,6 +627,9 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
 	}
 	/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
 
+	/* Clear wake status */
+	acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
+
 	acpi_gbl_system_awake_and_running = TRUE;
 
 	/* Enable power button */
Signature · 1 line
Matthew Garrett | [email protected]
#1 lore raw

Hey, why not:

/*
* 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.
*/
acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);

Quoted 26 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Matthew Garrett
Sent: Wednesday, August 06, 2008 10:58 AM
To: [email protected]
Cc: Brown, Len; [email protected]; [email protected]; [email protected]
Subject: [PATCH] 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.

---

I've had it confirmed by AMI that some of their BIOSes make this assumption - there may well be others out there as well.

drivers/acpi/hardware/hwsleep.c +0 -0
index dba3cfb..1cda856 100644

drivers/acpi/hardware/hwsleep.c acpi_status acpi_leave_sleep_state(u8 sleep_state) · line 628

Quoted 2 lines
drivers/acpi/hardware/hwsleep.c +0 -0
@@ -627,6 +627,9 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
 	}
 	/* TBD: _WAK "sometimes" returns stuff - do we want to look at

it? */

Quoted 9 lines
drivers/acpi/hardware/hwsleep.c +3 -1
+	/* Clear wake status */
+	acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1);
+
 	acpi_gbl_system_awake_and_running = TRUE;
 
 	/* Enable power button */
 
--
Quoted 3 lines

Matthew Garrett | [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi"

in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

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

drivers/acpi/hardware/hwsleep.c +7 -0
index dba3cfb..130a44b 100644
@@ -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 */
Signature · 1 line
Matthew Garrett | [email protected]
#3 lore raw
In reply to Matthew Garrett
Quoted 1 line · Matthew Garrett

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.

Queued for test thanks.

-Andi

#4 lore raw
Quoted 7 lines · On Monday 11 August 2008 13:25:15 Andi Kleen wrote:
Quoted 4 lines · Matthew Garrett

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.

Queued for test thanks.

This sounds like a bug fix, depending on what "fail to reboot correctly" exactly means, it sounds like a critical bug.
Shouldn't this still be queued for .27?
Test means for next .28-rc1 cycle?

Thomas