mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: rjw@rjwysocki.net, lenb@kernel.org
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 2/2] ACPI/Wakup: Enable button wakeup GPEs if these GPEs have associated GPE methods.
Date: Tue,  8 Jul 2014 14:57:58 +0800	[thread overview]
Message-ID: <1404802679-24019-2-git-send-email-tianyu.lan@intel.com> (raw)
In-Reply-To: <1404802679-24019-1-git-send-email-tianyu.lan@intel.com>

The button wakeup GPEs are enabled unconditionally in the current world by
commit 2a5d24(ACPI / Wakeup: Enable button GPEs unconditionally during
initialization). Because button's GPE methods needs to be run to clear
GPE status on some machines when there is GPE interrupt. If not, it will
cause machines resume immediately after being suspended since GPE status
isn't cleared correctly.

But if there is no GPE method for button wakeup GPE, these GPEs should not
be enabled since nothing needs to be done when they are triggered and this
also causes LID GPE storm on Lenovo Ideapad y560p.

This patch is to check Button GPE method and enable it if there is associated
GPE method.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=61051
Reported-by: James Tocknell<aragilar@gmail.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/acpi/wakeup.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c
index 1638401..5b20ae4 100644
--- a/drivers/acpi/wakeup.c
+++ b/drivers/acpi/wakeup.c
@@ -86,9 +86,14 @@ int __init acpi_wakeup_device_init(void)
 						       struct acpi_device,
 						       wakeup_list);
 		if (device_can_wakeup(&dev->dev)) {
-			/* Button GPEs are supposed to be always enabled. */
-			acpi_enable_gpe(dev->wakeup.gpe_device,
-					dev->wakeup.gpe_number);
+			/*
+			 * Button GPEs are supposed to be always enabled if
+			 * they have associated GPE methods.
+			 */
+			if (ACPI_SUCCESS(acpi_check_gpe_method(
+			    dev->wakeup.gpe_device, dev->wakeup.gpe_number)))
+				acpi_enable_gpe(dev->wakeup.gpe_device,
+						dev->wakeup.gpe_number);
 			device_set_wakeup_enable(&dev->dev, true);
 		}
 	}
-- 
1.8.4.rc0.1.g8f6a3e5.dirty


  reply	other threads:[~2014-07-08  7:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08  6:57 [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE method Lan Tianyu
2014-07-08  6:57 ` Lan Tianyu [this message]
2014-07-08 13:26   ` [RFC PATCH 2/2] ACPI/Wakup: Enable button wakeup GPEs if these GPEs have associated GPE methods Rafael J. Wysocki
2014-07-09  3:08     ` Lan Tianyu
2014-07-09 13:00       ` Rafael J. Wysocki
2014-07-08 13:19 ` [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE method Rafael J. Wysocki
2014-07-10 19:32 ` Moore, Robert
2014-07-11  2:35   ` Lan Tianyu

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=1404802679-24019-2-git-send-email-tianyu.lan@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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

Powered by JetHome