public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Clear WAK_STS on resume
@ 2008-08-06 17:58 Matthew Garrett
  2008-08-06 18:01 ` Moore, Robert
  2008-08-11 11:25 ` Andi Kleen
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Garrett @ 2008-08-06 17:58 UTC (permalink / raw)
  To: linux-acpi; +Cc: len.brown, pavel, rjw, ak

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.

Signed-off-by: Matthew Garrett <mjg@redhat.com>

---

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

diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index dba3cfb..1cda856 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -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 */

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* RE: [PATCH] Clear WAK_STS on resume
  2008-08-06 17:58 [PATCH] Clear WAK_STS on resume Matthew Garrett
@ 2008-08-06 18:01 ` Moore, Robert
  2008-08-06 18:12   ` Matthew Garrett
  2008-08-11 11:25 ` Andi Kleen
  1 sibling, 1 reply; 5+ messages in thread
From: Moore, Robert @ 2008-08-06 18:01 UTC (permalink / raw)
  To: Matthew Garrett, linux-acpi; +Cc: Brown, Len, pavel, rjw, ak

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);

>-----Original Message-----
>From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
>owner@vger.kernel.org] On Behalf Of Matthew Garrett
>Sent: Wednesday, August 06, 2008 10:58 AM
>To: linux-acpi@vger.kernel.org
>Cc: Brown, Len; pavel@suse.cz; rjw@sisk.pl; ak@linux.intel.com
>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.
>
>Signed-off-by: Matthew Garrett <mjg@redhat.com>
>
>---
>
>I've had it confirmed by AMI that some of their BIOSes make this
>assumption - there may well be others out there as well.
>
>diff --git a/drivers/acpi/hardware/hwsleep.c
>b/drivers/acpi/hardware/hwsleep.c
>index dba3cfb..1cda856 100644
>--- a/drivers/acpi/hardware/hwsleep.c
>+++ b/drivers/acpi/hardware/hwsleep.c
>@@ -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 */
>
>--
>Matthew Garrett | mjg59@srcf.ucam.org
>--
>To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Clear WAK_STS on resume
  2008-08-06 18:01 ` Moore, Robert
@ 2008-08-06 18:12   ` Matthew Garrett
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Garrett @ 2008-08-06 18:12 UTC (permalink / raw)
  To: Moore, Robert; +Cc: linux-acpi, Brown, Len, pavel, rjw, ak

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.                                                                                                                                                                      
                                                                                                                                                                                                       
Signed-off-by: Matthew Garrett <mjg@redhat.com>                                                                                                                                                        
                            
---

Comment clarified as suggested by Bob Moore

diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index dba3cfb..130a44b 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 */

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH] Clear WAK_STS on resume
  2008-08-06 17:58 [PATCH] Clear WAK_STS on resume Matthew Garrett
  2008-08-06 18:01 ` Moore, Robert
@ 2008-08-11 11:25 ` Andi Kleen
  2008-08-11 12:51   ` Thomas Renninger
  1 sibling, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2008-08-11 11:25 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-acpi, len.brown, pavel, rjw

Matthew Garrett wrote:
> 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


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

* Re: [PATCH] Clear WAK_STS on resume
  2008-08-11 11:25 ` Andi Kleen
@ 2008-08-11 12:51   ` Thomas Renninger
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Renninger @ 2008-08-11 12:51 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Matthew Garrett, linux-acpi, len.brown, pavel, rjw

On Monday 11 August 2008 13:25:15 Andi Kleen wrote:
> Matthew Garrett wrote:
> > 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

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

end of thread, other threads:[~2008-08-11 12:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 17:58 [PATCH] Clear WAK_STS on resume Matthew Garrett
2008-08-06 18:01 ` Moore, Robert
2008-08-06 18:12   ` Matthew Garrett
2008-08-11 11:25 ` Andi Kleen
2008-08-11 12:51   ` Thomas Renninger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox