public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@srcf.ucam.org>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: linux-acpi@vger.kernel.org, "Brown, Len" <len.brown@intel.com>,
	pavel@suse.cz, rjw@sisk.pl, ak@linux.intel.com
Subject: Re: [PATCH] Clear WAK_STS on resume
Date: Wed, 6 Aug 2008 19:12:04 +0100	[thread overview]
Message-ID: <20080806181204.GA27374@srcf.ucam.org> (raw)
In-Reply-To: <9D39833986E69849A2A8E74C1078B6B3CE0ABE@orsmsx415.amr.corp.intel.com>

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

  reply	other threads:[~2008-08-06 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-08-11 11:25 ` Andi Kleen
2008-08-11 12:51   ` Thomas Renninger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806181204.GA27374@srcf.ucam.org \
    --to=mjg59@srcf.ucam.org \
    --cc=ak@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=rjw@sisk.pl \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox