public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix IRQ / GPEs restore on wake
@ 2004-04-17 21:51 Karol Kozimor
       [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
       [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A==@public.gmane.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Karol Kozimor @ 2004-04-17 21:51 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Robert.Moore-ral2JQCrhuEAvxtiuMwx3w

Hi,
This patch (originally by Alexander Malysh) reorders the IRQ / GPEs restore
on wake-up from S1/S3. Without this patch no ACPI interrupts are received
after S1 / S3 and in consequence, ACPI-driven hotkeys stop working. This
affects certain (probably all) ASUS laptops as well as possibly other 
machines depending on those features. The patch addresses bug #2321
directly and #1409 partly. It was prepared against 2.6.5-mm6.

Can somebody comment on that?
Best regards,

-- 
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] fix IRQ / GPEs restore on wake
@ 2004-04-20 19:50 Moore, Robert
       [not found] ` <37F890616C995246BE76B3E6B2DBE05571648F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Moore, Robert @ 2004-04-20 19:50 UTC (permalink / raw)
  To: eric.valette-GANU6spQydw,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Grover, Andrew, Brown, Len


Please explain the reasoning behind this change.

It looks as though you want to enable the runtime GPEs before executing
_SST, _BFS, and _WAK.  Is this correct?  Why?

Bob


> -----Original Message-----
> From: Eric Valette [mailto:eric.valette-GANU6spQydw@public.gmane.org]
> Sent: Sunday, April 18, 2004 5:30 AM
> To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Cc: Moore, Robert
> Subject: Re: [ACPI] [PATCH] fix IRQ / GPEs restore on wake
> 
> 
> --- a/drivers/acpi/hardware/hwsleep.c	2004-04-17 22:57:11.000000000
> +0200
> +++ b/drivers/acpi/hardware/hwsleep.c	2004-04-17 23:12:08.000000000
> +0200
> @@ -512,6 +512,16 @@ acpi_leave_sleep_state (
> 
>   	acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID;
> 
> +	/*
> +	 * Restore the GPEs:
> +	 * 1) Disable all wakeup GPEs
> +	 * 2) Enable all runtime GPEs
> +	 */
> +	status = acpi_hw_restore_gpes_on_wake ();
> +	if (ACPI_FAILURE (status)) {
> +		ACPI_REPORT_ERROR(("Could not enable non wakeup GPEs,
%s\n",
> acpi_format_exception (status)));
> +	}
> +
>   	/* Setup parameter object */
> 
>   	arg_list.count = 1;
> @@ -538,16 +548,6 @@ acpi_leave_sleep_state (
>   	}
>   	/* TBD: _WAK "sometimes" returns stuff - do we want to look at
it?
> */
> 
> -	/*
> -	 * Restore the GPEs:
> -	 * 1) Disable all wakeup GPEs
> -	 * 2) Enable all runtime GPEs
> -	 */
> -	status = acpi_hw_restore_gpes_on_wake ();
> -	if (ACPI_FAILURE (status)) {
> -		return_ACPI_STATUS (status);
> -	}
> -
>   	/* Enable power button */
> 
> 
>
acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].ena
bl
> e_register_id,
> --- a/drivers/acpi/sleep/main.c	2004-04-17 22:55:12.000000000
+0200
> +++ b/drivers/acpi/sleep/main.c	2004-04-17 23:09:45.000000000
+0200
> @@ -107,7 +107,6 @@ static int acpi_pm_enter(u32 state)
>   	default:
>   		return -EINVAL;
>   	}
> -	local_irq_restore(flags);
>   	printk(KERN_DEBUG "Back to C!\n");
> 
>   	/* restore processor state
> @@ -118,6 +117,8 @@ static int acpi_pm_enter(u32 state)
>   	if (state > PM_SUSPEND_STANDBY)
>   		acpi_restore_state_mem();
> 
> +	acpi_leave_sleep_state(state);
> +	local_irq_restore(flags);
> 
>   	return ACPI_SUCCESS(status) ? 0 : -EFAULT;
>   }
> @@ -133,8 +134,6 @@ static int acpi_pm_enter(u32 state)
> 
>   static int acpi_pm_finish(u32 state)
>   {
> -	acpi_leave_sleep_state(state);
> -
>   	/* reset firmware waking vector */
>   	acpi_set_firmware_waking_vector((acpi_physical_address) 0);
> 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] fix IRQ / GPEs restore on wake
@ 2004-04-20 21:07 Moore, Robert
       [not found] ` <37F890616C995246BE76B3E6B2DBE05571657B-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Moore, Robert @ 2004-04-20 21:07 UTC (permalink / raw)
  To: eric.valette-GANU6spQydw
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew,
	Brown, Len, Karol Kozimor, a.malysh-1WJ9BOJEYl0b1SvskN2V4Q

The next version of ACPI CA will better manage wake vs. run vs. wake/run
GPEs and may handle this correctly without the change below.

Bob


> -----Original Message-----
> From: Eric Valette [mailto:eric.valette-GANU6spQydw@public.gmane.org]
> Sent: Tuesday, April 20, 2004 1:53 PM
> To: Moore, Robert
> Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org; Grover, Andrew; Brown, Len;
Karol
> Kozimor; a.malysh-1WJ9BOJEYl0b1SvskN2V4Q@public.gmane.org
> Subject: Re: [ACPI] [PATCH] fix IRQ / GPEs restore on wake
> 
> Moore, Robert wrote:
> > Please explain the reasoning behind this change.
> >
> > It looks as though you want to enable the runtime GPEs before
executing
> > _SST, _BFS, and _WAK.  Is this correct?  Why?
> >
> > Bob
> 
> First sorry for the message : I did not intend to post it to the list.
I
> was editing (mozilla edit as new) original Karol Kozimor message to
this
> list containing this exact patch to apply it on my ASUS L3800C
(because
> mailer though the diff was a signature) and hit sent button by error.
> 
> But anyway, this patch enables to get ACPI interrupts after resuming
> from S3. Without this patch, after _sucessfully_ resuming from S3, I
get
> no more events for ACPI buttons (except power button).
> 
> Get more info at <http://bugme.osdl.org/show_bug.cgi?id=2321>
> 
> This patch is not from me but from Alexander Malysh
> <a.malysh-1WJ9BOJEYl0b1SvskN2V4Q@public.gmane.org> so maybe he could explain it better than me.
> 
> I just can say it _indeed_ works...
> 
> -- eric


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click

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

end of thread, other threads:[~2004-04-30 20:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-17 21:51 [PATCH] fix IRQ / GPEs restore on wake Karol Kozimor
     [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-04-17 22:05   ` Karol Kozimor
     [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A==@public.gmane.org>
2004-04-18 12:29   ` Eric Valette
  -- strict thread matches above, loose matches on Subject: below --
2004-04-20 19:50 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE05571648F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-20 20:40   ` Alexander Malysh
2004-04-20 20:53   ` Eric Valette
2004-04-20 21:07 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE05571657B-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-30 19:50   ` Eric Valette
     [not found]     ` <4092ADEF.2000505-GANU6spQydw@public.gmane.org>
2004-04-30 19:57       ` Karol Kozimor
     [not found]         ` <20040430195701.GA10958-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-04-30 20:12           ` Eric Valette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox