ACPICA branch
Subsystems (2)
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
In reply to Zhang, RuiQuoted 13 lines · Rui
Hi, all,
With Yakui's help, we've root caused this problem.
For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but doesn't enable them in HW in
acpi_ev_gpe_initialize.
And inacpi_ev_install_fadt_gpes, the GPEs that are shown in_PRWmethods but don't have _Lxx/_Exx methods are disabled inacpi_ev_set_type, before 6217 is applied, theacpi_ev_disable_gpewon't write the GPE enable register and everything goes well.
But with 6217 applied,acpi_ev_disable_gpewill write the GPE enable register and enable all the _Lxx/_Exx GPEs as a side effect.
Quoted 8 lines
And the error message is printed out if a _Lxx/_Exx GPE is fired and try to access EC address space.
Of cource this can be solved by Alexey's patch which installs the EC address space handler before any GPE is enabled in HW.
But there is still one problem with both 6217 and 9916 applied which I'll talk about in the next email. :)
Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE and a RUN_WAKE GPE at the same time,
Before 6217 and 9916 are applied, Linux disable the wake GPEs in acpi_ev_install_fadt_gpes, call _PSW to disable the device's wakeup ability in acpi_scan_init, and re-enable the GPE as a RUN_WAKE GPE in acpi_button_add.
But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx GPEs in acpi_ec_ecdt_probe, and won't disable it until acpi_ev_install_fadt_gpes. And this may bring an interrupt storm because the _PSW is not called and the wakeup GPE keeps on firing.
IMO, we should revert the 9916 patch because Yakui reproduced the problem on T61 and confirm it's fixed by a BIOS update, maybe we should ask the bug reporter to test the new BIOS as well. :)
For bug 6217, we should do the following for stray GPEs:
1. get the current value of GPE_ENABLE register
2. clear the stray GPE bit of GPE_ENABLE register
3. write the value back
Any comments on this?
thanks,
rui
Quoted 220 lines
Thanks,
RuiQuoted 10 lines
-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsYes, this is my question also.
I hope Alexey can help with this. I'm very nervous about any code that
works
Quoted 1 line
or does not work for reasons unknown. When this happens in the GPE
code, I get
Quoted 19 lines
more than nervous.
Bob
-----Original Message-----
From: Zhang, Rui
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsQuoted 5 lines · Len Brown
oh goody, i thought this one rang a bell...
I'll apply 6217 on top of 9916 (which was already in the test tree, but not on the acpica branch)
Quoted 12 lines
Quoted 1 line
the error goes away with both applied.
I still don't see why the error messages pop up if 6217 is applied. IMO, 6217 won't enable the EC GPE. :(
thanks,
ruiQuoted 4 lines · Robert
Quoted 3 lines
Alexey,
I remember there was some discussion on this, but I'm still not
sure
Quoted 17 lines
Quoted 17 lines
why
Quoted 1 line
the patch for 6217 (Ignore GPE if valid and not enabled) makes the
other
Quoted 12 lines
problem (too early enabling of GPEs) apparent. Please explain.
Thanks,
BobQuoted 6 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spuriousGPEs
Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · Len Brown
Quoted 5 lines · Len Brown
From: Bob Moore <[email protected]>
Implemented another change to eliminate/suppress spurious or stray GPEs. The AcpiEvDisableGpe function will now disable GPEs that are neither enabled nor disabled -- meaning that the GPE
is
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
unknown to the system. This will prevent future interrupts from that GPE. (Zhang Rui) BZ 6217
Signed-off-by Bob Moore <[email protected]>Signed-off-by Alexey Starikovskiy <[email protected]>Signed-off-by Len Brown <[email protected]>--- drivers/acpi/events/evgpe.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/events/evgpe.cQuoted 6 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct
Quoted 4 lines
index 897baed..6940f5d 100644
drivers/acpi/events/evgpe.c +0
-0@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
acpi_gpe_event_info*gpe_event_info)Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/events/evgpe.c
Quoted 7 lines
ACPI_FUNCTION_TRACE(ev_disable_gpe);- if (!(gpe_event_info->flags &
ACPI_GPE_ENABLE_MASK)) {
+ /*drivers/acpi/events/evgpe.c +3
-0+* Ignore this if the GPE is valid and not enabled. +* +* Flags is only zero if GPE is neither enabled or disabled --
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
it may
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ * be a spurious or stray GPE -- disable it in the default
case
Quoted 9 lines
Quoted 9 lines
below.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3
-0+*/ +if (gpe_event_info->flags && + (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK ))) {return_ACPI_STATUS (AE_OK ); }Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
When applied to 2.6.25, the patch above causes ACPI Error
messages
Quoted 3 lines
below
Quoted 2 lines
on my T61.
Quoted 1 line
Certainly this is a case of the EC getting an interrupt (GPE
x02)
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
before
Quoted 5 lines
it has initialized.
Quoted 2 lines
Perhaps it breaks the call of
acpi_install_gpe_handler()to
acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is alreadythere...
Quoted 4 lines
Quoted 4 lines
It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-Len
PCI: Using MMCONFIG at
f0000000-f3ffffff
PCI: Using configuration type 1
evgpeblk-0956 [00]ev_create_gpe_block: GPE 00 to 1F [_GPE]4
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
regs on
Quoted 4 lines
int
0x9Quoted 1 line
+ACPI Error (evregion-0316): No handler for Region [ECOR]
(
ffff81007d35dda0) [EmbeddedControl] [20070126]Quoted 1 line
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
handler
Quoted 3 lines
Quoted 3 lines
[20070126]
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node
ffff81007d364ab0),
AE_NOT_EXISTQuoted 2 lines
Quoted 2 lines
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node
ffff81007d364f48),Quoted 8 lines
Quoted 8 lines
AE_NOT_EXISTQuoted 7 lines
Quoted 1 line
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
Quoted 2 lines
(Node
ffff81007d376420),AE_NOT_EXISTQuoted 1 line
+ACPI Exception (evgpe-0584):
AE_NOT_EXIST, while evaluating GPEmethod
Quoted 2 lines
[
_L02] [20070126]Quoted 1 line
evgpeblk-1052 [00]
ev_initialize_gpe_bloc: Found 9 Wake,Enabled
Quoted 33 lines
Quoted 8 lines
3
Quoted 3 lines
Quoted 3 lines
Runtime GPEs in this block
Quoted 2 lines
ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interruptmode
Quoted 2 lines
Quoted 1 line
Quoted 1 line
-Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 8 lines
Quoted 7 lines
....
Quoted 2 lines
................
Quoted 1 line
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
+Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
Quoted 16 lines
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 11 lines
Quoted 8 lines
....
Quoted 2 lines
.................
Quoted 1 line
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 4 lines
(1888 nodes)
Quoted 1 line
Initializing Device/Processor/Thermal objects by executing
_INImethods:.<5>ACPI: BIOS
_OSI(Linux)query honored via DMIQuoted 1 line
+ACPI: EC: non-query interrupt received, switching to interrupt
mode
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.......
Executed 8_INImethods requiring 2_STAexecutions (examined88
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
objects)
Quoted 1 line
ACPI: Interpreter enabled
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
In reply to Zhang, RuiQuoted 10 lines · Rui
Hi, all,
With Yakui's help, we've root caused this problem.
For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but doesn't enable them in HW in
acpi_ev_gpe_initialize.
And inacpi_ev_install_fadt_gpes, the GPEs that are shown in_PRWmethods but don't have _Lxx/_Exx methods are disabled inacpi_ev_set_type, before 6217 is applied, theacpi_ev_disable_gpewon't write the GPE enable register and everything goes well.
Agree. For the _PRW GPE ,the GPE will be firstly disabled when the GPE type is switched from TYPE_RUN to TYPE_WAKE. Before the patch in bug 6217 is applied, acpi_ev_disable_gpe only updates the mask bit and won't access the GPE enable register. After the patch is applied, the _PRW GPE without _LXX/_EXX method will be treated as the stray GPE. The GPE enable register will be accessed and the side effect is that some GPEs with _LXX/EXX are also enabled. In fact this is not what we expected. Maybe it is reasonable that OS clears the responding GPE bit in the GPE enable register when disabling the stray GPE.
Quoted 227 lines
But with 6217 applied,
acpi_ev_disable_gpewill write the GPE enable register and enable all the _Lxx/_Exx GPEs as a side effect.And the error message is printed out if a _Lxx/_Exx GPE is fired and try to access EC address space.
Of cource this can be solved by Alexey's patch which installs the EC address space handler before any GPE is enabled in HW.
But there is still one problem with both 6217 and 9916 applied which I'll talk about in the next email. :)
Thanks,
RuiQuoted 10 lines
-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsYes, this is my question also.
I hope Alexey can help with this. I'm very nervous about any code that
works
Quoted 1 line
or does not work for reasons unknown. When this happens in the GPE
code, I get
Quoted 19 lines
more than nervous.
Bob
-----Original Message-----
From: Zhang, Rui
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsQuoted 5 lines · Len Brown
oh goody, i thought this one rang a bell...
I'll apply 6217 on top of 9916 (which was already in the test tree, but not on the acpica branch)
Quoted 12 lines
Quoted 1 line
the error goes away with both applied.
I still don't see why the error messages pop up if 6217 is applied. IMO, 6217 won't enable the EC GPE. :(
thanks,
ruiQuoted 4 lines · Robert
Quoted 3 lines
Alexey,
I remember there was some discussion on this, but I'm still not
sure
Quoted 17 lines
Quoted 17 lines
why
Quoted 1 line
the patch for 6217 (Ignore GPE if valid and not enabled) makes the
other
Quoted 12 lines
problem (too early enabling of GPEs) apparent. Please explain.
Thanks,
BobQuoted 6 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spuriousGPEs
Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · Len Brown
Quoted 5 lines · Len Brown
From: Bob Moore <[email protected]>
Implemented another change to eliminate/suppress spurious or stray GPEs. The AcpiEvDisableGpe function will now disable GPEs that are neither enabled nor disabled -- meaning that the GPE
is
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
unknown to the system. This will prevent future interrupts from that GPE. (Zhang Rui) BZ 6217
Signed-off-by Bob Moore <[email protected]>Signed-off-by Alexey Starikovskiy <[email protected]>Signed-off-by Len Brown <[email protected]>--- drivers/acpi/events/evgpe.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/events/evgpe.cQuoted 6 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct
Quoted 4 lines
index 897baed..6940f5d 100644
drivers/acpi/events/evgpe.c +0
-0@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
acpi_gpe_event_info*gpe_event_info)Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/events/evgpe.c
Quoted 7 lines
ACPI_FUNCTION_TRACE(ev_disable_gpe);- if (!(gpe_event_info->flags &
ACPI_GPE_ENABLE_MASK)) {
+ /*drivers/acpi/events/evgpe.c +3
-0+* Ignore this if the GPE is valid and not enabled. +* +* Flags is only zero if GPE is neither enabled or disabled --
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
it may
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ * be a spurious or stray GPE -- disable it in the default
case
Quoted 9 lines
Quoted 9 lines
below.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3
-0+*/ +if (gpe_event_info->flags && + (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK ))) {return_ACPI_STATUS (AE_OK ); }Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
When applied to 2.6.25, the patch above causes ACPI Error
messages
Quoted 3 lines
below
Quoted 2 lines
on my T61.
Quoted 1 line
Certainly this is a case of the EC getting an interrupt (GPE
x02)
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
before
Quoted 5 lines
it has initialized.
Quoted 2 lines
Perhaps it breaks the call of
acpi_install_gpe_handler()to
acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is alreadythere...
Quoted 4 lines
Quoted 4 lines
It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-Len
PCI: Using MMCONFIG at
f0000000-f3ffffff
PCI: Using configuration type 1
evgpeblk-0956 [00]ev_create_gpe_block: GPE 00 to 1F [_GPE]4
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
regs on
Quoted 4 lines
int
0x9Quoted 1 line
+ACPI Error (evregion-0316): No handler for Region [ECOR]
(
ffff81007d35dda0) [EmbeddedControl] [20070126]Quoted 1 line
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
handler
Quoted 3 lines
Quoted 3 lines
[20070126]
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node
ffff81007d364ab0),
AE_NOT_EXISTQuoted 2 lines
Quoted 2 lines
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node
ffff81007d364f48),Quoted 8 lines
Quoted 8 lines
AE_NOT_EXISTQuoted 7 lines
Quoted 1 line
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
Quoted 2 lines
(Node
ffff81007d376420),AE_NOT_EXISTQuoted 1 line
+ACPI Exception (evgpe-0584):
AE_NOT_EXIST, while evaluating GPEmethod
Quoted 2 lines
[
_L02] [20070126]Quoted 1 line
evgpeblk-1052 [00]
ev_initialize_gpe_bloc: Found 9 Wake,Enabled
Quoted 33 lines
Quoted 8 lines
3
Quoted 3 lines
Quoted 3 lines
Runtime GPEs in this block
Quoted 2 lines
ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interruptmode
Quoted 2 lines
Quoted 1 line
Quoted 1 line
-Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 8 lines
Quoted 7 lines
....
Quoted 2 lines
................
Quoted 1 line
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
+Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
Quoted 16 lines
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 11 lines
Quoted 8 lines
....
Quoted 2 lines
.................
Quoted 1 line
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 4 lines
(1888 nodes)
Quoted 1 line
Initializing Device/Processor/Thermal objects by executing
_INImethods:.<5>ACPI: BIOS
_OSI(Linux)query honored via DMIQuoted 1 line
+ACPI: EC: non-query interrupt received, switching to interrupt
mode
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.......
Executed 8_INImethods requiring 2_STAexecutions (examined88
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
objects)
Quoted 1 line
ACPI: Interpreter enabled
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
In reply to Zhang RuiQuoted 30 lines · Zhang Rui
Quoted 13 lines · Rui
Hi, all,
With Yakui's help, we've root caused this problem.
For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but doesn't enable them in HW in
acpi_ev_gpe_initialize.
And inacpi_ev_install_fadt_gpes, the GPEs that are shown in_PRWmethods but don't have _Lxx/_Exx methods are disabled inacpi_ev_set_type, before 6217 is applied, theacpi_ev_disable_gpewon't write the GPE enable register and everything goes well.
But with 6217 applied,acpi_ev_disable_gpewill write the GPE enable register and enable all the _Lxx/_Exx GPEs as a side effect.Quoted 8 lines
And the error message is printed out if a _Lxx/_Exx GPE is fired and try to access EC address space.
Of cource this can be solved by Alexey's patch which installs the EC address space handler before any GPE is enabled in HW.
But there is still one problem with both 6217 and 9916 applied which I'll talk about in the next email. :)
Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE and a
RUN_WAKEGPE at the same time,Before 6217 and 9916 are applied, Linux disable the wake GPEs in
acpi_ev_install_fadt_gpes, call_PSWto disable the device's wakeup ability inacpi_scan_init, and re-enable the GPE as aRUN_WAKEGPE inacpi_button_add.
Quoted 4 lines
But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx GPEs in
acpi_ec_ecdt_probe, and won't disable it untilacpi_ev_install_fadt_gpes. And this may bring an interrupt storm because the_PSWis not called and the wakeup GPE keeps on firing.
What your said is right.
The _PRW GPE will be disabled and all the other RUN_TIME GPEs will enabled in the function of acpi_ev_install_fadt_gpes.
After the patches in bug 9916 is applied, some _PRW GPEs will be enabled when EC GPE is enabled in the course of EC initialization. Before the _PRW GPE is disabled again, maybe there will be interrupt storm.
Quoted 3 lines
IMO, we should revert the 9916 patch because Yakui reproduced the problem on T61 and confirm it's fixed by a BIOS update, maybe we should ask the bug reporter to test the new BIOS as well. :)
Agree. It is very lucky that there is T61 notebook in hand. The error can be fixed by upgrading BIOS.
The patch in bug 9916 expectes that FADT GPEs are enabled after EC is initialized. In fact this is applicable only for the bios with ECDT table.(Of course the EC device with _INI object is also OK.). When there is no ECDT table and the EC device has no _INI object, the FADT GPEs still are enabled before EC initialization.
Quoted 4 lines
For bug 6217, we should do the following for stray GPEs:
1. get the current value ofGPE_ENABLEregister
2. clear the stray GPE bit ofGPE_ENABLEregister
3. write the value back
Agree. It is reasonable that OS clears the corresponding GPE bit of GPE enable register when the stray GPE is disabled.
Quoted 227 lines
Any comments on this?
thanks,
ruiQuoted 220 lines
Thanks,
RuiQuoted 10 lines
-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsYes, this is my question also.
I hope Alexey can help with this. I'm very nervous about any code that
works
Quoted 1 line
or does not work for reasons unknown. When this happens in the GPE
code, I get
Quoted 19 lines
more than nervous.
Bob
-----Original Message-----
From: Zhang, Rui
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEsQuoted 5 lines · Len Brown
oh goody, i thought this one rang a bell...
I'll apply 6217 on top of 9916 (which was already in the test tree, but not on the acpica branch)
Quoted 12 lines
Quoted 1 line
the error goes away with both applied.
I still don't see why the error messages pop up if 6217 is applied. IMO, 6217 won't enable the EC GPE. :(
thanks,
ruiQuoted 4 lines · Robert
Quoted 3 lines
Alexey,
I remember there was some discussion on this, but I'm still not
sure
Quoted 17 lines
Quoted 17 lines
why
Quoted 1 line
the patch for 6217 (Ignore GPE if valid and not enabled) makes the
other
Quoted 12 lines
problem (too early enabling of GPEs) apparent. Please explain.
Thanks,
BobQuoted 6 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spuriousGPEs
Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · Len Brown
Quoted 5 lines · Len Brown
From: Bob Moore <[email protected]>
Implemented another change to eliminate/suppress spurious or stray GPEs. The AcpiEvDisableGpe function will now disable GPEs that are neither enabled nor disabled -- meaning that the GPE
is
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
unknown to the system. This will prevent future interrupts from that GPE. (Zhang Rui) BZ 6217
Signed-off-by Bob Moore <[email protected]>Signed-off-by Alexey Starikovskiy <[email protected]>Signed-off-by Len Brown <[email protected]>--- drivers/acpi/events/evgpe.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/events/evgpe.cQuoted 6 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct
Quoted 4 lines
index 897baed..6940f5d 100644
drivers/acpi/events/evgpe.c +0
-0@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
acpi_gpe_event_info*gpe_event_info)Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/events/evgpe.c
Quoted 7 lines
ACPI_FUNCTION_TRACE(ev_disable_gpe);- if (!(gpe_event_info->flags &
ACPI_GPE_ENABLE_MASK)) {
+ /*drivers/acpi/events/evgpe.c +3
-0+* Ignore this if the GPE is valid and not enabled. +* +* Flags is only zero if GPE is neither enabled or disabled --
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
it may
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ * be a spurious or stray GPE -- disable it in the default
case
Quoted 9 lines
Quoted 9 lines
below.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3
-0+*/ +if (gpe_event_info->flags && + (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK ))) {return_ACPI_STATUS (AE_OK ); }Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
When applied to 2.6.25, the patch above causes ACPI Error
messages
Quoted 3 lines
below
Quoted 2 lines
on my T61.
Quoted 1 line
Certainly this is a case of the EC getting an interrupt (GPE
x02)
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
before
Quoted 5 lines
it has initialized.
Quoted 2 lines
Perhaps it breaks the call of
acpi_install_gpe_handler()to
acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is alreadythere...
Quoted 4 lines
Quoted 4 lines
It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-Len
PCI: Using MMCONFIG at
f0000000-f3ffffff
PCI: Using configuration type 1
evgpeblk-0956 [00]ev_create_gpe_block: GPE 00 to 1F [_GPE]4
Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
regs on
Quoted 4 lines
int
0x9Quoted 1 line
+ACPI Error (evregion-0316): No handler for Region [ECOR]
(
ffff81007d35dda0) [EmbeddedControl] [20070126]Quoted 1 line
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
handler
Quoted 3 lines
Quoted 3 lines
[20070126]
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node
ffff81007d364ab0),
AE_NOT_EXISTQuoted 2 lines
Quoted 2 lines
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node
ffff81007d364f48),Quoted 8 lines
Quoted 8 lines
AE_NOT_EXISTQuoted 7 lines
Quoted 1 line
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
Quoted 2 lines
(Node
ffff81007d376420),AE_NOT_EXISTQuoted 1 line
+ACPI Exception (evgpe-0584):
AE_NOT_EXIST, while evaluating GPEmethod
Quoted 2 lines
[
_L02] [20070126]Quoted 1 line
evgpeblk-1052 [00]
ev_initialize_gpe_bloc: Found 9 Wake,Enabled
Quoted 33 lines
Quoted 8 lines
3
Quoted 3 lines
Quoted 3 lines
Runtime GPEs in this block
Quoted 2 lines
ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interruptmode
Quoted 2 lines
Quoted 1 line
Quoted 1 line
-Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 8 lines
Quoted 7 lines
....
Quoted 2 lines
................
Quoted 1 line
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
+Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
Quoted 16 lines
.......................................................................
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 11 lines
Quoted 8 lines
....
Quoted 2 lines
.................
Quoted 1 line
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 4 lines
(1888 nodes)
Quoted 1 line
Initializing Device/Processor/Thermal objects by executing
_INImethods:.<5>ACPI: BIOS
_OSI(Linux)query honored via DMIQuoted 1 line
+ACPI: EC: non-query interrupt received, switching to interrupt
mode
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.......
Executed 8_INImethods requiring 2_STAexecutions (examined88
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
objects)
Quoted 1 line
ACPI: Interpreter enabled
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
In reply to Zhang RuiRui,
Thanks for examining this issue in detail. Your proposal to read/update/write the GPE enable register to simply disable one GPE sounds interesting. I want to think about this a bit more -- it has been a long time since I have looked closely at the GPE handling.
With my discussions with Alexey Starikovskiy, we have concluded that there is something incorrect about the current design, where there exist windows where a GPE could come in with no driver available to handle it.
I'm no longer intimate with the GPE handling model, but it would seem to me that GPEs should be treated like other interrupts where an interrupt level remains disabled until a driver is installed which in turn calls the kernel to install a handler for that interrupt. Only then can the interrupt be safely enabled.
There is added complexity since drivers (with the exception of the Embedded Controller) do not handle GPEs directly; instead, an _Lxx/_Exx method is run which in turn (usually) generates a Notify on a device. We expect the device driver for the device to have installed a notify handler.
So it would seem to me that it would be architecturally best to leave a GPE disabled until either a handler for the GPE is installed, or a notify handler is installed for the device associated with the GPE.
What am I missing?
Bob
Quoted 5 lines
-----Original Message-----
From: Zhang, Rui
Sent: Wednesday, May 21, 2008 9:56 AM
To: Moore, Robert
Cc: Len Brown; Alexey Starikovskiy; [email protected]; Zhao,
Yakui
Quoted 9 lines
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
Quoted 5 lines · Rui
Hi, all,
With Yakui's help, we've root caused this problem.
For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask
but
Quoted 4 lines
Quoted 4 lines
doesn't enable them in HW in
acpi_ev_gpe_initialize. And inacpi_ev_install_fadt_gpes, the GPEs that are shown in_PRWmethods but don't have _Lxx/_Exx methods are disabled inacpi_ev_set_type, before 6217 is applied, theacpi_ev_disable_gpe
won't
Quoted 5 lines
Quoted 5 lines
write the GPE enable register and everything goes well. But with 6217 applied,
acpi_ev_disable_gpewill write the GPE enable register and enable all the _Lxx/_Exx GPEs as a side effect.And the error message is printed out if a _Lxx/_Exx GPE is fired and
try
Quoted 10 lines
Quoted 7 lines
to access EC address space.
Of cource this can be solved by Alexey's patch which installs the EC address space handler before any GPE is enabled in HW.
But there is still one problem with both 6217 and 9916 applied which I'll talk about in the next email. :)
Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE and a
RUN_WAKEGPE at the same time,
Quoted 6 lines
Before 6217 and 9916 are applied, Linux disable the wake GPEs in
acpi_ev_install_fadt_gpes, call_PSWto disable the device's wakeup ability inacpi_scan_init, and re-enable the GPE as aRUN_WAKEGPE inacpi_button_add.But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx
GPEs
Quoted 2 lines
in
acpi_ec_ecdt_probe, and won't disable it untilacpi_ev_install_fadt_gpes. And this may bring an interrupt storm
because
Quoted 11 lines
the
_PSWis not called and the wakeup GPE keeps on firing.IMO, we should revert the 9916 patch because Yakui reproduced the problem on T61 and confirm it's fixed by a BIOS update, maybe we should ask the bug reporter to test the new BIOS as well. :)
For bug 6217, we should do the following for stray GPEs:
1. get the current value ofGPE_ENABLEregister
2. clear the stray GPE bit ofGPE_ENABLEregister
3. write the value back
Quoted 15 lines
Any comments on this?
thanks,
ruiQuoted 10 lines
Thanks,
RuiQuoted 6 lines
-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Yes, this is my question also.
I hope Alexey can help with this. I'm very nervous about any code
that
Quoted 8 lines
Quoted 8 lines
works
Quoted 1 line
or does not work for reasons unknown. When this happens in the GPE
code, I get
Quoted 5 lines
more than nervous.
Bob
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Zhang, Rui
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Len Brown
Quoted 3 lines
oh goody, i thought this one rang a bell...
I'll apply 6217 on top of 9916 (which was already in the test
tree,
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
but not on the acpica branch)
the error goes away with both applied.
I still don't see why the error messages pop up if 6217 is applied. IMO, 6217 won't enable the EC GPE. :(
thanks,
rui
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines · Robert
Quoted 3 lines
Alexey,
I remember there was some discussion on this, but I'm still not
sure
Quoted 2 lines
Quoted 2 lines
why
Quoted 1 line
the patch for 6217 (Ignore GPE if valid and not enabled) makes
the
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
other
Quoted 6 lines
problem (too early enabling of GPEs) apparent. Please explain.
Thanks,
Bob
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown
spurious
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
GPEs
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines · Len Brown
Quoted 4 lines · Len Brown
From: Bob Moore <[email protected]>
Implemented another change to eliminate/suppress spurious or stray GPEs. The AcpiEvDisableGpe function will now disable
GPEs
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
that are neither enabled nor disabled -- meaning that the
GPE
Quoted 2 lines
Quoted 2 lines
is
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
unknown to the system. This will prevent future interrupts
from
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 10 lines
Quoted 10 lines
Review
Quoted 10 lines
that GPE. (Zhang Rui) BZ 6217
Signed-off-by Bob Moore <[email protected]>Signed-off-by Alexey Starikovskiy <[email protected]>Signed-off-by Len Brown <[email protected]>--- drivers/acpi/events/evgpe.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/events/evgpe.cQuoted 6 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct
Quoted 4 lines
index 897baed..6940f5d 100644
drivers/acpi/events/evgpe.c +0
-0@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
acpi_gpe_event_info*gpe_event_info)Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/events/evgpe.c
Quoted 7 lines
ACPI_FUNCTION_TRACE(ev_disable_gpe);- if (!(gpe_event_info->flags &
ACPI_GPE_ENABLE_MASK)) {
+ /*drivers/acpi/events/evgpe.c +3
-0+* Ignore this if the GPE is valid and not enabled. +* +* Flags is only zero if GPE is neither enabled or
disabled
Quoted 19 lines
Quoted 19 lines
--
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
it may
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ * be a spurious or stray GPE -- disable it in the default
case
Quoted 9 lines
Quoted 9 lines
below.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3
-0+*/ +if (gpe_event_info->flags && + (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK ))) {return_ACPI_STATUS (AE_OK ); }Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
When applied to 2.6.25, the patch above causes ACPI Error
messages
Quoted 3 lines
below
Quoted 2 lines
on my T61.
Quoted 1 line
Certainly this is a case of the EC getting an interrupt (GPE
x02)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
before
Quoted 5 lines
it has initialized.
Quoted 2 lines
Perhaps it breaks the call of
acpi_install_gpe_handler()to
acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is alreadythere...
Quoted 1 line
Quoted 1 line
It is wroong to enable GPE before handler for it is
installed...
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
http://bugzilla.kernel.org/show_bug.cgi?id=9916
Quoted 7 lines
-Len
PCI: Using MMCONFIG at
f0000000-f3ffffff
PCI: Using configuration type 1
evgpeblk-0956 [00]ev_create_gpe_block: GPE 00 to 1F
[_GPE]
Quoted 10 lines
Quoted 10 lines
4
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
regs on
Quoted 4 lines
int
0x9Quoted 1 line
+ACPI Error (evregion-0316): No handler for Region [ECOR]
(
ffff81007d35dda0) [EmbeddedControl] [20070126]Quoted 1 line
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
handler
Quoted 3 lines
Quoted 3 lines
[20070126]
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node
ffff81007d364ab0),
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
AE_NOT_EXISTQuoted 2 lines
Quoted 2 lines
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node
ffff81007d364f48),
AE_NOT_EXISTQuoted 4 lines
Quoted 1 line
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
Quoted 2 lines
(Node
ffff81007d376420),AE_NOT_EXISTQuoted 1 line
+ACPI Exception (evgpe-0584):
AE_NOT_EXIST, while evaluating
GPE
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
method
Quoted 2 lines
[
_L02] [20070126]Quoted 1 line
evgpeblk-1052 [00]
ev_initialize_gpe_bloc: Found 9 Wake,Enabled
Quoted 4 lines
Quoted 4 lines
3
Quoted 3 lines
Quoted 3 lines
Runtime GPEs in this block
Quoted 2 lines
ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to
interrupt
Quoted 34 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
mode
Quoted 2 lines
Quoted 1 line
Quoted 1 line
-Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
.......................................................................
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
....
Quoted 2 lines
................
Quoted 1 line
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
+Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
Quoted 12 lines
.......................................................................
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
....
Quoted 2 lines
.................
Quoted 1 line
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
Initializing Device/Processor/Thermal objects by executing
_INI
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
methods:.<5>ACPI: BIOS
_OSI(Linux)query honored via DMIQuoted 1 line
+ACPI: EC: non-query interrupt received, switching to
interrupt
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
mode
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.......
Executed 8_INImethods requiring 2_STAexecutions
(examined
Quoted 10 lines
Quoted 10 lines
88
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
objects)
Quoted 1 line
ACPI: Interpreter enabled
Quoted 2 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
Quoted 2 lines
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
Quoted 23 lines · Robert
Rui,
Thanks for examining this issue in detail. Your proposal to read/update/write the GPE enable register to simply disable one GPE sounds interesting. I want to think about this a bit more -- it has been a long time since I have looked closely at the GPE handling.
With my discussions with Alexey Starikovskiy, we have concluded that there is something incorrect about the current design, where there exist windows where a GPE could come in with no driver available to handle it.
I'm no longer intimate with the GPE handling model, but it would seem to me that GPEs should be treated like other interrupts where an interrupt level remains disabled until a driver is installed which in turn calls the kernel to install a handler for that interrupt. Only then can the interrupt be safely enabled.
There is added complexity since drivers (with the exception of the Embedded Controller) do not handle GPEs directly; instead, an _Lxx/_Exx method is run which in turn (usually) generates a Notify on a device. We expect the device driver for the device to have installed a notify handler.
Quoted 5 lines
So it would seem to me that it would be architecturally best to leave a GPE disabled until either a handler for the GPE is installed, or a notify handler is installed for the device associated with the GPE.
Currently, there is no way to tell if GPE hanler method would do Notify() to some device. There could be any number of calls to other methods, which might cause call of Notify().
So, probably this is a dead end.
The only implementable way I see is to move enabling of _Lxx/_Exx GPEs to after bus scan, there we have devices autoloaded and installed.
Regards,
Alex.
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
Quoted 2 lines
Currently, there is no way to tell if GPE hanler method would do
Notify()to some device.
Yep, I thought that might be the issue.
So, GPE is an interrupt mechanism with no way to map an interrupt to a particular device or driver. So I guess that it is then appropriate for us to simply enable all GPEs that have associated _Lxx/_Exx methods, and hope that a driver will come along sometime to handle any associated notifies. Meaning that all GPEs from the device will be missed until such time as the driver is loaded.
What if ACPICA did not enable GPEs until after it received a call from the host that the namespace has been scanned, and all ACPI-related drivers have been loaded and initialized? Instead of one-by-one enabling GPEs as drivers came up, wait until *all* drivers are ready?
Bob
Quoted 8 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Thursday, May 22, 2008 9:56 AM
To: Moore, Robert
Cc: Zhang, Rui; Therien, Guy; Len Brown; Alexey Starikovskiy; linux- [email protected]; Zhao, Yakui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
Quoted 6 lines
Quoted 5 lines · Robert
Rui,
Thanks for examining this issue in detail. Your proposal to read/update/write the GPE enable register to simply disable one GPE sounds interesting. I want to think about this a bit more -- it has
been
Quoted 4 lines
Quoted 4 lines
a long time since I have looked closely at the GPE handling.
With my discussions with Alexey Starikovskiy, we have concluded that there is something incorrect about the current design, where there
exist
Quoted 1 line
Quoted 1 line
windows where a GPE could come in with no driver available to handle
it.
Quoted 2 lines
Quoted 2 lines
I'm no longer intimate with the GPE handling model, but it would seem
to
Quoted 1 line
Quoted 1 line
me that GPEs should be treated like other interrupts where an
interrupt
Quoted 1 line
Quoted 1 line
level remains disabled until a driver is installed which in turn
calls
Quoted 5 lines
Quoted 5 lines
the kernel to install a handler for that interrupt. Only then can the interrupt be safely enabled.
There is added complexity since drivers (with the exception of the Embedded Controller) do not handle GPEs directly; instead, an
_Lxx/_Exx
Quoted 1 line
Quoted 1 line
method is run which in turn (usually) generates a Notify on a device.
We
Quoted 4 lines
Quoted 4 lines
expect the device driver for the device to have installed a notify handler.
So it would seem to me that it would be architecturally best to leave
a
Quoted 6 lines
Quoted 4 lines
GPE disabled until either a handler for the GPE is installed, or a notify handler is installed for the device associated with the GPE.
Currently, there is no way to tell if GPE hanler method would do
Notify()to some device. There could be any number of calls to
other
Quoted 3 lines
methods, which might cause call of
Notify().
So, probably this is a dead end.
The only implementable way I see is to move enabling of _Lxx/_Exx GPEs
to
Quoted 4 lines
after bus scan, there we have devices autoloaded and installed.
Regards,
Alex.
RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
In reply to Zhang RuiQuoted 4 lines
For bug 6217, we should do the following for stray GPEs:
1. get the current value ofGPE_ENABLEregister
2. clear the stray GPE bit ofGPE_ENABLEregister
3. write the value back
I think we will give this a go.
Quoted 5 lines
-----Original Message-----
From: Zhang, Rui
Sent: Wednesday, May 21, 2008 9:56 AM
To: Moore, Robert
Cc: Len Brown; Alexey Starikovskiy; [email protected]; Zhao,
Yakui
Quoted 9 lines
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
Quoted 5 lines · Rui
Hi, all,
With Yakui's help, we've root caused this problem.
For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask
but
Quoted 4 lines
Quoted 4 lines
doesn't enable them in HW in
acpi_ev_gpe_initialize. And inacpi_ev_install_fadt_gpes, the GPEs that are shown in_PRWmethods but don't have _Lxx/_Exx methods are disabled inacpi_ev_set_type, before 6217 is applied, theacpi_ev_disable_gpe
won't
Quoted 5 lines
Quoted 5 lines
write the GPE enable register and everything goes well. But with 6217 applied,
acpi_ev_disable_gpewill write the GPE enable register and enable all the _Lxx/_Exx GPEs as a side effect.And the error message is printed out if a _Lxx/_Exx GPE is fired and
try
Quoted 10 lines
Quoted 7 lines
to access EC address space.
Of cource this can be solved by Alexey's patch which installs the EC address space handler before any GPE is enabled in HW.
But there is still one problem with both 6217 and 9916 applied which I'll talk about in the next email. :)
Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE and a
RUN_WAKEGPE at the same time,
Quoted 6 lines
Before 6217 and 9916 are applied, Linux disable the wake GPEs in
acpi_ev_install_fadt_gpes, call_PSWto disable the device's wakeup ability inacpi_scan_init, and re-enable the GPE as aRUN_WAKEGPE inacpi_button_add.But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx
GPEs
Quoted 2 lines
in
acpi_ec_ecdt_probe, and won't disable it untilacpi_ev_install_fadt_gpes. And this may bring an interrupt storm
because
Quoted 11 lines
the
_PSWis not called and the wakeup GPE keeps on firing.IMO, we should revert the 9916 patch because Yakui reproduced the problem on T61 and confirm it's fixed by a BIOS update, maybe we should ask the bug reporter to test the new BIOS as well. :)
For bug 6217, we should do the following for stray GPEs:
1. get the current value ofGPE_ENABLEregister
2. clear the stray GPE bit ofGPE_ENABLEregister
3. write the value back
Quoted 15 lines
Any comments on this?
thanks,
ruiQuoted 10 lines
Thanks,
RuiQuoted 6 lines
-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Yes, this is my question also.
I hope Alexey can help with this. I'm very nervous about any code
that
Quoted 8 lines
Quoted 8 lines
works
Quoted 1 line
or does not work for reasons unknown. When this happens in the GPE
code, I get
Quoted 5 lines
more than nervous.
Bob
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Zhang, Rui
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Len Brown
Quoted 3 lines
oh goody, i thought this one rang a bell...
I'll apply 6217 on top of 9916 (which was already in the test
tree,
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
but not on the acpica branch)
the error goes away with both applied.
I still don't see why the error messages pop up if 6217 is applied. IMO, 6217 won't enable the EC GPE. :(
thanks,
rui
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines · Robert
Quoted 3 lines
Alexey,
I remember there was some discussion on this, but I'm still not
sure
Quoted 2 lines
Quoted 2 lines
why
Quoted 1 line
the patch for 6217 (Ignore GPE if valid and not enabled) makes
the
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
other
Quoted 6 lines
problem (too early enabling of GPEs) apparent. Please explain.
Thanks,
Bob
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown
spurious
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
GPEs
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines · Len Brown
Quoted 4 lines · Len Brown
From: Bob Moore <[email protected]>
Implemented another change to eliminate/suppress spurious or stray GPEs. The AcpiEvDisableGpe function will now disable
GPEs
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
that are neither enabled nor disabled -- meaning that the
GPE
Quoted 2 lines
Quoted 2 lines
is
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
unknown to the system. This will prevent future interrupts
from
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 10 lines
Quoted 10 lines
Review
Quoted 10 lines
that GPE. (Zhang Rui) BZ 6217
Signed-off-by Bob Moore <[email protected]>Signed-off-by Alexey Starikovskiy <[email protected]>Signed-off-by Len Brown <[email protected]>--- drivers/acpi/events/evgpe.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/acpi/events/evgpe.cQuoted 6 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct
Quoted 4 lines
index 897baed..6940f5d 100644
drivers/acpi/events/evgpe.c +0
-0@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
acpi_gpe_event_info*gpe_event_info)Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/acpi/events/evgpe.c
Quoted 7 lines
ACPI_FUNCTION_TRACE(ev_disable_gpe);- if (!(gpe_event_info->flags &
ACPI_GPE_ENABLE_MASK)) {
+ /*drivers/acpi/events/evgpe.c +3
-0+* Ignore this if the GPE is valid and not enabled. +* +* Flags is only zero if GPE is neither enabled or
disabled
Quoted 19 lines
Quoted 19 lines
--
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
it may
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ * be a spurious or stray GPE -- disable it in the default
case
Quoted 9 lines
Quoted 9 lines
below.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3
-0+*/ +if (gpe_event_info->flags && + (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK ))) {return_ACPI_STATUS (AE_OK ); }Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
When applied to 2.6.25, the patch above causes ACPI Error
messages
Quoted 3 lines
below
Quoted 2 lines
on my T61.
Quoted 1 line
Certainly this is a case of the EC getting an interrupt (GPE
x02)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
before
Quoted 5 lines
it has initialized.
Quoted 2 lines
Perhaps it breaks the call of
acpi_install_gpe_handler()to
acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is alreadythere...
Quoted 1 line
Quoted 1 line
It is wroong to enable GPE before handler for it is
installed...
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
http://bugzilla.kernel.org/show_bug.cgi?id=9916
Quoted 7 lines
-Len
PCI: Using MMCONFIG at
f0000000-f3ffffff
PCI: Using configuration type 1
evgpeblk-0956 [00]ev_create_gpe_block: GPE 00 to 1F
[_GPE]
Quoted 10 lines
Quoted 10 lines
4
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
regs on
Quoted 4 lines
int
0x9Quoted 1 line
+ACPI Error (evregion-0316): No handler for Region [ECOR]
(
ffff81007d35dda0) [EmbeddedControl] [20070126]Quoted 1 line
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
handler
Quoted 3 lines
Quoted 3 lines
[20070126]
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node
ffff81007d364ab0),
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
AE_NOT_EXISTQuoted 2 lines
Quoted 2 lines
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node
ffff81007d364f48),
AE_NOT_EXISTQuoted 4 lines
Quoted 1 line
Quoted 1 line
+ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
Quoted 2 lines
(Node
ffff81007d376420),AE_NOT_EXISTQuoted 1 line
+ACPI Exception (evgpe-0584):
AE_NOT_EXIST, while evaluating
GPE
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
method
Quoted 2 lines
[
_L02] [20070126]Quoted 1 line
evgpeblk-1052 [00]
ev_initialize_gpe_bloc: Found 9 Wake,Enabled
Quoted 4 lines
Quoted 4 lines
3
Quoted 3 lines
Quoted 3 lines
Runtime GPEs in this block
Quoted 2 lines
ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to
interrupt
Quoted 34 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
mode
Quoted 2 lines
Quoted 1 line
Quoted 1 line
-Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
.......................................................................
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
....
Quoted 2 lines
................
Quoted 1 line
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
+Completing Region/Field/Buffer/Package
initialization:........................................................
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
....
Quoted 2 lines
............................................................
Quoted 1 line
Quoted 12 lines
.......................................................................
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
....
.......................................................................
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
....
Quoted 2 lines
.................
Quoted 1 line
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
Quoted 2 lines
(1888 nodes)
Quoted 1 line
Initializing Device/Processor/Thermal objects by executing
_INI
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
methods:.<5>ACPI: BIOS
_OSI(Linux)query honored via DMIQuoted 1 line
+ACPI: EC: non-query interrupt received, switching to
interrupt
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
mode
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.......
Executed 8_INImethods requiring 2_STAexecutions
(examined
Quoted 10 lines
Quoted 10 lines
88
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
objects)
Quoted 1 line
ACPI: Interpreter enabled
Quoted 2 lines
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
Quoted 2 lines
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html