linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPICA: Clear status of all events when entering sleep states
@ 2018-08-12 10:50 Rafael J. Wysocki
  2018-08-13 17:15 ` Schmauss, Erik
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2018-08-12 10:50 UTC (permalink / raw)
  To: Linux ACPI; +Cc: Paul Menzel, Linux PM, LKML, Erik Schmauss

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Commit fa85015c0d95 (ACPICA: Clear status of all events when entering
S5) made the sleep state entry code in ACPICA clear the status of all
ACPI events when entering S5 to fix a functional regression reported
against commit 18996f2db918 (ACPICA: Events: Stop unconditionally
clearing ACPI IRQs during suspend/resume).  However, it is reported
now that the regression also affects system states other than S5 on
some systems and causes them to wake up from sleep prematurely.

For this reason, make the code in question clear the status of all
ACPI events when entering all sleep states (in addition to S5) to
avoid the premature wakeups (this may cause some wakeup events to
be missed in theory, but the likelihood of that is small and the
change here simply restores the previous behavior of the code).

Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume)
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+: fa85015c0d95 ACPICA: Clear status ...
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpica/hwsleep.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Index: linux-pm/drivers/acpi/acpica/hwsleep.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpica/hwsleep.c
+++ linux-pm/drivers/acpi/acpica/hwsleep.c
@@ -56,14 +56,9 @@ acpi_status acpi_hw_legacy_sleep(u8 slee
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
-	/*
-	 * If the target sleep state is S5, clear all GPEs and fixed events too
-	 */
-	if (sleep_state == ACPI_STATE_S5) {
-		status = acpi_hw_clear_acpi_status();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
+	status = acpi_hw_clear_acpi_status();
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
 	}
 	acpi_gbl_system_awake_and_running = FALSE;
 


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

* RE: [PATCH] ACPICA: Clear status of all events when entering sleep states
  2018-08-12 10:50 [PATCH] ACPICA: Clear status of all events when entering sleep states Rafael J. Wysocki
@ 2018-08-13 17:15 ` Schmauss, Erik
  2018-08-14 10:09   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Schmauss, Erik @ 2018-08-13 17:15 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux ACPI; +Cc: Paul Menzel, Linux PM, LKML



> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of Rafael J. Wysocki
> Sent: Sunday, August 12, 2018 3:50 AM
> To: Linux ACPI <linux-acpi@vger.kernel.org>
> Cc: Paul Menzel <pmenzel@molgen.mpg.de>; Linux PM <linux-
> pm@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>; Schmauss, Erik
> <erik.schmauss@intel.com>
> Subject: [PATCH] ACPICA: Clear status of all events when entering sleep states
> 
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit fa85015c0d95 (ACPICA: Clear status of all events when entering
> S5) made the sleep state entry code in ACPICA clear the status of all ACPI events
> when entering S5 to fix a functional regression reported against commit
> 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during
> suspend/resume).  However, it is reported now that the regression also affects
> system states other than S5 on some systems and causes them to wake up from
> sleep prematurely.
> 
> For this reason, make the code in question clear the status of all ACPI events
> when entering all sleep states (in addition to S5) to avoid the premature
> wakeups (this may cause some wakeup events to be missed in theory, but the
> likelihood of that is small and the change here simply restores the previous
> behavior of the code).
> 
> Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs
> during suspend/resume)
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Cc: 4.17+ <stable@vger.kernel.org> # 4.17+: fa85015c0d95 ACPICA: Clear
> status ...
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/acpi/acpica/hwsleep.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> Index: linux-pm/drivers/acpi/acpica/hwsleep.c
> =================================================================
> ==
> --- linux-pm.orig/drivers/acpi/acpica/hwsleep.c
> +++ linux-pm/drivers/acpi/acpica/hwsleep.c
> @@ -56,14 +56,9 @@ acpi_status acpi_hw_legacy_sleep(u8 slee
>  	if (ACPI_FAILURE(status)) {
>  		return_ACPI_STATUS(status);
>  	}
> -	/*
> -	 * If the target sleep state is S5, clear all GPEs and fixed events too
> -	 */
> -	if (sleep_state == ACPI_STATE_S5) {
> -		status = acpi_hw_clear_acpi_status();
> -		if (ACPI_FAILURE(status)) {
> -			return_ACPI_STATUS(status);
> -		}
> +	status = acpi_hw_clear_acpi_status();
> +	if (ACPI_FAILURE(status)) {
> +		return_ACPI_STATUS(status);
>  	}
>  	acpi_gbl_system_awake_and_running = FALSE;
> 

I'll backport this for the next ACPICA release

Thanks,
Erik

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

* Re: [PATCH] ACPICA: Clear status of all events when entering sleep states
  2018-08-13 17:15 ` Schmauss, Erik
@ 2018-08-14 10:09   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2018-08-14 10:09 UTC (permalink / raw)
  To: Schmauss, Erik; +Cc: Linux ACPI, Paul Menzel, Linux PM, LKML

On Monday, August 13, 2018 7:15:19 PM CEST Schmauss, Erik wrote:
> 
> > -----Original Message-----
> > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> > owner@vger.kernel.org] On Behalf Of Rafael J. Wysocki
> > Sent: Sunday, August 12, 2018 3:50 AM
> > To: Linux ACPI <linux-acpi@vger.kernel.org>
> > Cc: Paul Menzel <pmenzel@molgen.mpg.de>; Linux PM <linux-
> > pm@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>; Schmauss, Erik
> > <erik.schmauss@intel.com>
> > Subject: [PATCH] ACPICA: Clear status of all events when entering sleep states
> > 
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Commit fa85015c0d95 (ACPICA: Clear status of all events when entering
> > S5) made the sleep state entry code in ACPICA clear the status of all ACPI events
> > when entering S5 to fix a functional regression reported against commit
> > 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during
> > suspend/resume).  However, it is reported now that the regression also affects
> > system states other than S5 on some systems and causes them to wake up from
> > sleep prematurely.
> > 
> > For this reason, make the code in question clear the status of all ACPI events
> > when entering all sleep states (in addition to S5) to avoid the premature
> > wakeups (this may cause some wakeup events to be missed in theory, but the
> > likelihood of that is small and the change here simply restores the previous
> > behavior of the code).
> > 
> > Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs
> > during suspend/resume)
> > Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> > Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> > Cc: 4.17+ <stable@vger.kernel.org> # 4.17+: fa85015c0d95 ACPICA: Clear
> > status ...
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/acpi/acpica/hwsleep.c |   11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > Index: linux-pm/drivers/acpi/acpica/hwsleep.c
> > =================================================================
> > ==
> > --- linux-pm.orig/drivers/acpi/acpica/hwsleep.c
> > +++ linux-pm/drivers/acpi/acpica/hwsleep.c
> > @@ -56,14 +56,9 @@ acpi_status acpi_hw_legacy_sleep(u8 slee
> >  	if (ACPI_FAILURE(status)) {
> >  		return_ACPI_STATUS(status);
> >  	}
> > -	/*
> > -	 * If the target sleep state is S5, clear all GPEs and fixed events too
> > -	 */
> > -	if (sleep_state == ACPI_STATE_S5) {
> > -		status = acpi_hw_clear_acpi_status();
> > -		if (ACPI_FAILURE(status)) {
> > -			return_ACPI_STATUS(status);
> > -		}
> > +	status = acpi_hw_clear_acpi_status();
> > +	if (ACPI_FAILURE(status)) {
> > +		return_ACPI_STATUS(status);
> >  	}
> >  	acpi_gbl_system_awake_and_running = FALSE;
> > 
> 
> I'll backport this for the next ACPICA release

Thanks!


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

end of thread, other threads:[~2018-08-14 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-12 10:50 [PATCH] ACPICA: Clear status of all events when entering sleep states Rafael J. Wysocki
2018-08-13 17:15 ` Schmauss, Erik
2018-08-14 10:09   ` Rafael J. Wysocki

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