lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3011365.oYtXFx0LHa@vostro.rjw.lan>
Date:	Tue, 08 Jul 2014 15:26:45 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Lan Tianyu <tianyu.lan@...el.com>
Cc:	lenb@...nel.org, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] ACPI/Wakup: Enable button wakeup GPEs if these GPEs have associated GPE methods.

On Tuesday, July 08, 2014 02:57:58 PM Lan Tianyu wrote:
> 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.

Part of the problem is that we call acpi_setup_gpe_for_wake() for buttons too
and it sets ACPI_GPE_DISPATCH_NOTIFY unconditionally.  While we could address
this the way you're proposing, it seems a bit less than straightforward so to
speak.

Let me think more about how to address that.

> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=61051
> Reported-by: James Tocknell<aragilar@...il.com>
> Signed-off-by: Lan Tianyu <tianyu.lan@...el.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);
>  		}
>  	}
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ