* [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[parent not found: <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org> @ 2004-04-17 22:05 ` Karol Kozimor 0 siblings, 0 replies; 10+ messages in thread From: Karol Kozimor @ 2004-04-17 22:05 UTC (permalink / raw) To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Cc: Robert.Moore-ral2JQCrhuEAvxtiuMwx3w Thus wrote Karol Kozimor: > Can somebody comment on that? Either the patch got eaten or I forgot to attach it, here it is: -- Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org --- 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].enable_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=1470&alloc_id=3638&op=click ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A==@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <20040417215139.GA17862-DETuoxkZsSqrDJvtcaxF/A==@public.gmane.org> @ 2004-04-18 12:29 ` Eric Valette 0 siblings, 0 replies; 10+ messages in thread From: Eric Valette @ 2004-04-18 12:29 UTC (permalink / raw) To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Cc: Robert.Moore-ral2JQCrhuEAvxtiuMwx3w== --- 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].enable_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=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[parent not found: <37F890616C995246BE76B3E6B2DBE05571648F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <37F890616C995246BE76B3E6B2DBE05571648F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2004-04-20 20:40 ` Alexander Malysh 2004-04-20 20:53 ` Eric Valette 1 sibling, 0 replies; 10+ messages in thread From: Alexander Malysh @ 2004-04-20 20:40 UTC (permalink / raw) To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Cc: Moore, Robert, eric.valette-GANU6spQydw, Grover, Andrew, Brown, Len [-- Attachment #1: Type: text/plain, Size: 4014 bytes --] Hi Robert, On Tuesday 20 April 2004 21:50, 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? because at least on my laptop after executing of _WAK irq's are enabled, so stored gpe bits (before suspend) will be overwriten and not restored correctly while resume... > > 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 > _______________________________________________ > Acpi-devel mailing list > Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/acpi-devel -- Best regards / Mit besten Grüßen aus Düsseldorf Dipl.-Ing. Alexander Malysh ___________________________________________ Centrium GmbH Vogelsanger Weg 80 40470 Düsseldorf Fon: +49 (0211) 74 84 51 80 Fax: +49 (0211) 277 49 109 email: a.malysh (at) centrium.de web: www.centrium.de msn: a.malysh (at) centrium.de icq: 98063111 ___________________________________________ Please avoid sending me Word, Excel or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html [-- Attachment #2: signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <37F890616C995246BE76B3E6B2DBE05571648F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2004-04-20 20:40 ` Alexander Malysh @ 2004-04-20 20:53 ` Eric Valette 1 sibling, 0 replies; 10+ messages in thread From: Eric Valette @ 2004-04-20 20:53 UTC (permalink / raw) To: Moore, Robert Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew, Brown, Len, Karol Kozimor, a.malysh-1WJ9BOJEYl0b1SvskN2V4Q 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=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 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[parent not found: <37F890616C995246BE76B3E6B2DBE05571657B-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <37F890616C995246BE76B3E6B2DBE05571657B-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2004-04-30 19:50 ` Eric Valette [not found] ` <4092ADEF.2000505-GANU6spQydw@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Eric Valette @ 2004-04-30 19:50 UTC (permalink / raw) To: Moore, Robert Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew, Brown, Len, Karol Kozimor, a.malysh-1WJ9BOJEYl0b1SvskN2V4Q [-- Attachment #1: Type: text/plain, Size: 1597 bytes --] Moore, Robert wrote: > 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 OK. This was fair enough but as I have tried 2.6.6-rc3-mm1 that contains: ACPI: Subsystem revision 20040326 I still says that the attached patch is indeed badly needed to fix bug described in <http://bugme.osdl.org/show_bug.cgi?id=2321>. Now, as : 1) this bug is open with several proposed patches for several kernel versions for more than a month and a half, 2) that I never heard anything serious by ACPI developpers about possible issue of irq incorrectly restored because (at least on my ASUS L3800C) after executing of _WAK irq's are enabled, so stored gpe bits (before suspend) will be overwriten and not restored correctly while resume (bug analysis by Alexander Malysh), I would _really_ like to have someone _really_ analyse what happens (I can put any trace in my kernel if you ask for it) and propose a better fix if this one is not the best way to fix it. I suspect the problem exist on other systems but as only _few_ do correctly wakeup from S3, and even _less_ using dedicated ACPI buttons, they are just too many other bugs masking the importance of this one... But not correctly restoring interrupt status is generally a good way to crash a system... -- __ / ` Eric Valette /-- __ o _. 6 rue Paul Le Flem (___, / (_(_(__ 35740 Pace Tel: +33 (0)2 99 85 26 76 Fax: +33 (0)2 99 85 26 76 E-mail: eric.valette-GANU6spQydw@public.gmane.org [-- Attachment #2: acpi-irq-gpe-restore-on-wake.txt --] [-- Type: text/plain, Size: 1815 bytes --] --- 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].enable_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); ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <4092ADEF.2000505-GANU6spQydw@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <4092ADEF.2000505-GANU6spQydw@public.gmane.org> @ 2004-04-30 19:57 ` Karol Kozimor [not found] ` <20040430195701.GA10958-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Karol Kozimor @ 2004-04-30 19:57 UTC (permalink / raw) To: Eric Valette Cc: Moore, Robert, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew, Brown, Len, a.malysh-1WJ9BOJEYl0b1SvskN2V4Q Thus wrote Eric Valette: > Moore, Robert wrote: > >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 > > OK. This was fair enough but as I have tried 2.6.6-rc3-mm1 that contains: > > ACPI: Subsystem revision 20040326 I guess Robert meant post-20040326... Best regards, -- Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20040430195701.GA10958-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>]
* Re: [PATCH] fix IRQ / GPEs restore on wake [not found] ` <20040430195701.GA10958-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org> @ 2004-04-30 20:12 ` Eric Valette 0 siblings, 0 replies; 10+ messages in thread From: Eric Valette @ 2004-04-30 20:12 UTC (permalink / raw) To: Karol Kozimor Cc: Moore, Robert, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew, Brown, Len, a.malysh-1WJ9BOJEYl0b1SvskN2V4Q Karol Kozimor wrote: > Thus wrote Eric Valette: > >>Moore, Robert wrote: >> >>>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 >> >>OK. This was fair enough but as I have tried 2.6.6-rc3-mm1 that contains: >> >>ACPI: Subsystem revision 20040326 > > > I guess Robert meant post-20040326... > Best regards, > I misread the date, I just _really_ saw 20040426 :-( When will we be able to test something to see if the bug is really gone or not? Should I really get files directly from ACPI tree via bitkeeper? At least this served to complete the bug description with an updated patche and to record the explanation by original author... Sorry for the trouble, -- eric ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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