linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] clear GPE earily in resume
@ 2007-06-14  1:36 Shaohua Li
  2007-06-19 22:06 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Shaohua Li @ 2007-06-14  1:36 UTC (permalink / raw)
  To: linux acpi; +Cc: Len Brown, Rafael J. Wysocki, robert.moore

Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
acpi_leave_sleep_state will clear the GPE but it's too late, we should
doe it before interrupt is re-enabled. 

Maybe we should just clear wakeup GPE here, but clear all GPEs sounds
not harmful in my test. Not sure other systems.

Index: 2.6.22-rc/drivers/acpi/sleep/main.c
===================================================================
--- 2.6.22-rc.orig/drivers/acpi/sleep/main.c	2007-06-11 15:31:03.000000000 +0800
+++ 2.6.22-rc/drivers/acpi/sleep/main.c	2007-06-14 09:31:54.000000000 +0800
@@ -104,6 +104,8 @@
 	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
 		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
 
+	acpi_hw_disable_all_gpes();
+
 	local_irq_restore(flags);
 	printk(KERN_DEBUG "Back to C!\n");
 

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

* Re: [RFC] clear GPE earily in resume
  2007-06-14  1:36 [RFC] clear GPE earily in resume Shaohua Li
@ 2007-06-19 22:06 ` Rafael J. Wysocki
  2007-06-20  1:17   ` Shaohua Li
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2007-06-19 22:06 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux acpi, Len Brown, robert.moore

On Thursday, 14 June 2007 03:36, Shaohua Li wrote:
> Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> acpi_leave_sleep_state will clear the GPE but it's too late, we should
> doe it before interrupt is re-enabled. 
> 
> Maybe we should just clear wakeup GPE here, but clear all GPEs sounds
> not harmful in my test. Not sure other systems.

I think that the clearing all of the GPEs is the right thing to do here.

> Index: 2.6.22-rc/drivers/acpi/sleep/main.c
> ===================================================================
> --- 2.6.22-rc.orig/drivers/acpi/sleep/main.c	2007-06-11 15:31:03.000000000 +0800
> +++ 2.6.22-rc/drivers/acpi/sleep/main.c	2007-06-14 09:31:54.000000000 +0800
> @@ -104,6 +104,8 @@
>  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
>  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
>  

I'd add a comment saying why we're clearing the GPEs at this point.

> +	acpi_hw_disable_all_gpes();
> +
>  	local_irq_restore(flags);
>  	printk(KERN_DEBUG "Back to C!\n");
>  
> -

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

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

* Re: [RFC] clear GPE earily in resume
  2007-06-19 22:06 ` Rafael J. Wysocki
@ 2007-06-20  1:17   ` Shaohua Li
  2007-06-20 11:35     ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Shaohua Li @ 2007-06-20  1:17 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux acpi, Len Brown, robert.moore

On Wed, 2007-06-20 at 00:06 +0200, Rafael J. Wysocki wrote:
> On Thursday, 14 June 2007 03:36, Shaohua Li wrote:
> > Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> > USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> > acpi_leave_sleep_state will clear the GPE but it's too late, we should
> > doe it before interrupt is re-enabled. 
> > 
> > Maybe we should just clear wakeup GPE here, but clear all GPEs sounds
> > not harmful in my test. Not sure other systems.
> 
> I think that the clearing all of the GPEs is the right thing to do here.
> 
> > Index: 2.6.22-rc/drivers/acpi/sleep/main.c
> > ===================================================================
> > --- 2.6.22-rc.orig/drivers/acpi/sleep/main.c	2007-06-11 15:31:03.000000000 +0800
> > +++ 2.6.22-rc/drivers/acpi/sleep/main.c	2007-06-14 09:31:54.000000000 +0800
> > @@ -104,6 +104,8 @@
> >  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
> >  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
> >  
> 
> I'd add a comment saying why we're clearing the GPEs at this point.
added.

Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
acpi_leave_sleep_state will clear the GPE but it's too late, we should
do it before interrupt is re-enabled. 

diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index bc7e16e..9f36859 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -104,6 +104,13 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
 		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
 
+	/*
+	 * Disable and clear GPE status before interrupt is enabled. Some GPEs
+	 * (like wakeup GPE) haven't handler, this can avoid such GPE misfire.
+	 * acpi_leave_sleep_state will reenable specific GPEs later
+	 */
+	acpi_hw_disable_all_gpes();
+
 	local_irq_restore(flags);
 	printk(KERN_DEBUG "Back to C!\n");
 

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

* Re: [RFC] clear GPE earily in resume
  2007-06-20  1:17   ` Shaohua Li
@ 2007-06-20 11:35     ` Rafael J. Wysocki
  2007-12-13 22:26       ` Len Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2007-06-20 11:35 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux acpi, Len Brown, robert.moore

On Wednesday, 20 June 2007 03:17, Shaohua Li wrote:
> On Wed, 2007-06-20 at 00:06 +0200, Rafael J. Wysocki wrote:
> > On Thursday, 14 June 2007 03:36, Shaohua Li wrote:
> > > Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> > > USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> > > acpi_leave_sleep_state will clear the GPE but it's too late, we should
> > > doe it before interrupt is re-enabled. 
> > > 
> > > Maybe we should just clear wakeup GPE here, but clear all GPEs sounds
> > > not harmful in my test. Not sure other systems.
> > 
> > I think that the clearing all of the GPEs is the right thing to do here.
> > 
> > > Index: 2.6.22-rc/drivers/acpi/sleep/main.c
> > > ===================================================================
> > > --- 2.6.22-rc.orig/drivers/acpi/sleep/main.c	2007-06-11 15:31:03.000000000 +0800
> > > +++ 2.6.22-rc/drivers/acpi/sleep/main.c	2007-06-14 09:31:54.000000000 +0800
> > > @@ -104,6 +104,8 @@
> > >  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
> > >  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
> > >  
> > 
> > I'd add a comment saying why we're clearing the GPEs at this point.
> added.

Thanks.

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
 
> Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> acpi_leave_sleep_state will clear the GPE but it's too late, we should
> do it before interrupt is re-enabled. 
> 
> diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
> index bc7e16e..9f36859 100644
> --- a/drivers/acpi/sleep/main.c
> +++ b/drivers/acpi/sleep/main.c
> @@ -104,6 +104,13 @@ static int acpi_pm_enter(suspend_state_t pm_state)
>  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
>  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
>  
> +	/*
> +	 * Disable and clear GPE status before interrupt is enabled. Some GPEs
> +	 * (like wakeup GPE) haven't handler, this can avoid such GPE misfire.
> +	 * acpi_leave_sleep_state will reenable specific GPEs later
> +	 */
> +	acpi_hw_disable_all_gpes();
> +
>  	local_irq_restore(flags);
>  	printk(KERN_DEBUG "Back to C!\n");
>  
> 
> 

-- 
"Premature optimization is the root of all evil." - Donald Knuth

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

* Re: [RFC] clear GPE earily in resume
  2007-06-20 11:35     ` Rafael J. Wysocki
@ 2007-12-13 22:26       ` Len Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Len Brown @ 2007-12-13 22:26 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Shaohua Li, linux acpi, robert.moore

Applied to 2.6.25 queue

thanks,
-Len

On Wednesday 20 June 2007 07:35, Rafael J. Wysocki wrote:
> On Wednesday, 20 June 2007 03:17, Shaohua Li wrote:
> > On Wed, 2007-06-20 at 00:06 +0200, Rafael J. Wysocki wrote:
> > > On Thursday, 14 June 2007 03:36, Shaohua Li wrote:
> > > > Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> > > > USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> > > > acpi_leave_sleep_state will clear the GPE but it's too late, we should
> > > > doe it before interrupt is re-enabled. 
> > > > 
> > > > Maybe we should just clear wakeup GPE here, but clear all GPEs sounds
> > > > not harmful in my test. Not sure other systems.
> > > 
> > > I think that the clearing all of the GPEs is the right thing to do here.
> > > 
> > > > Index: 2.6.22-rc/drivers/acpi/sleep/main.c
> > > > ===================================================================
> > > > --- 2.6.22-rc.orig/drivers/acpi/sleep/main.c	2007-06-11 15:31:03.000000000 +0800
> > > > +++ 2.6.22-rc/drivers/acpi/sleep/main.c	2007-06-14 09:31:54.000000000 +0800
> > > > @@ -104,6 +104,8 @@
> > > >  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
> > > >  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
> > > >  
> > > 
> > > I'd add a comment saying why we're clearing the GPEs at this point.
> > added.
> 
> Thanks.
> 
> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
>  
> > Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
> > USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
> > acpi_leave_sleep_state will clear the GPE but it's too late, we should
> > do it before interrupt is re-enabled. 
> > 
> > diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
> > index bc7e16e..9f36859 100644
> > --- a/drivers/acpi/sleep/main.c
> > +++ b/drivers/acpi/sleep/main.c
> > @@ -104,6 +104,13 @@ static int acpi_pm_enter(suspend_state_t pm_state)
> >  	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
> >  		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);
> >  
> > +	/*
> > +	 * Disable and clear GPE status before interrupt is enabled. Some GPEs
> > +	 * (like wakeup GPE) haven't handler, this can avoid such GPE misfire.
> > +	 * acpi_leave_sleep_state will reenable specific GPEs later
> > +	 */
> > +	acpi_hw_disable_all_gpes();
> > +
> >  	local_irq_restore(flags);
> >  	printk(KERN_DEBUG "Back to C!\n");
> >  
> > 
> > 
> 

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

end of thread, other threads:[~2007-12-13 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14  1:36 [RFC] clear GPE earily in resume Shaohua Li
2007-06-19 22:06 ` Rafael J. Wysocki
2007-06-20  1:17   ` Shaohua Li
2007-06-20 11:35     ` Rafael J. Wysocki
2007-12-13 22:26       ` Len Brown

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