linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	anisse@astier.eu, "Zhang, Rui" <rui.zhang@intel.com>
Subject: [PATCH] ACPI : do not use Lid and Sleep button for S5 wakeup
Date: Mon, 03 Dec 2012 16:15:06 +0800	[thread overview]
Message-ID: <1354522506.3063.9.camel@rzhang1-mobl4> (raw)

>From 3e7b4da3783d200f35568f72b3b25f16df546ffe Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@intel.com>
Date: Fri, 30 Nov 2012 14:35:43 +0800
Subject: [PATCH] ACPI : do not use Lid and Sleep button for S5 wakeup

When system enters power off, the _PSW of Lid device is enabled.  
But this may cause the system to reboot instead of power off.

https://bugzilla.kernel.org/show_bug.cgi?id=35262

A proper way to fix this is to always disable lid wakeup capability
for S5.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/scan.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d1ecca2..f20020a 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -807,8 +807,8 @@ acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
 static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 {
 	struct acpi_device_id button_device_ids[] = {
-		{"PNP0C0D", 0},
 		{"PNP0C0C", 0},
+		{"PNP0C0D", 0},
 		{"PNP0C0E", 0},
 		{"", 0},
 	};
@@ -820,6 +820,11 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 	/* Power button, Lid switch always enable wakeup */
 	if (!acpi_match_device_ids(device, button_device_ids)) {
 		device->wakeup.flags.run_wake = 1;
+		if (!acpi_match_device_ids(device, &button_device_ids[1])) {
+			/* Do not use Lid/sleep button for S5 wakeup */
+			if (device->wakeup.gpe_number == 5)
+				device->wakeup.gpe_number = 4;
+		}
 		device_set_wakeup_capable(&device->dev, true);
 		return;
 	}
-- 
1.7.9.5




             reply	other threads:[~2012-12-03  8:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03  8:15 Zhang Rui [this message]
2012-12-04  0:02 ` [PATCH] ACPI : do not use Lid and Sleep button for S5 wakeup Rafael J. Wysocki
2012-12-04 16:06   ` Zhang Rui
2012-12-10 13:51     ` Anisse Astier
2012-12-10 14:44       ` Rafael J. Wysocki
2012-12-11  0:50       ` Zhang Rui

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=1354522506.3063.9.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=anisse@astier.eu \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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;
as well as URLs for NNTP newsgroup(s).