public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [ACPICA] EmbeddedControl region handling bug in PNP0C14
@ 2007-11-28  3:50 Carlos Corbacho
  2007-11-28 18:08 ` Moore, Robert
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-11-28  3:50 UTC (permalink / raw)
  To: Linux-acpi, Len Brown, Moore, Robert

The following is, I think, a bug in ACPICA (so CC'ing Robert Moore).

(The full DSDT for the laptop in question (Acer Aspire 5040) is available 
here - I'm just going to selectively quote from it in this e-mail:
http://aceracpi.googlecode.com/svn/trunk/dsdt/acer/aspire/5040.dsl
)

ACPI is choking on the second of two OperationRegion's in different parts of 
the DSDT, with the same name, and that both operate on the Embedded 
Controller.

This hasn't cropped up before on the laptop in question (an Acer Aspire 5040 - 
based on the DSDTs I've collected so far for Acer laptops, I suspect a few 
others will have the same problem), as the second OperationRegion, in this 
case, is found in \_SB.AMW0 (aka WMI-ACPI or PNP0C14); and in acer_acpi, I've 
only just started poking at this (the first time by accident, the second time 
by more closely studying the DSDT - unfortunately, I don't have the hardware 
in question).

So, on the DSDT in question, we are trying to call \_SB.AMW0.WMCA

In ACPI land, it takes three arguments:

1) Instance (ACPI_TYPE_INTEGER)
2) Method ID (ACPI_TYPE_INTEGER)
3) Buffer (u32 in this case)

When we call it (we already know what the correct values to pass are, both 
from reverse engineering, and from visual inspection of the DSDT), we always 
get the following result (this is from a user with a 2.6.22 kernel):

[  699.477048] ACPI Error (evregion-0316): No handler for Region [RAM_] 
(ffff8100012b7ac0) [EmbeddedControl] [20070126]
[  699.477055] ACPI Error (exfldio-0289): Region EmbeddedControl(3) has 
no handler [20070126]
[  699.477060] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While 
resolving operands for [OpcodeName unavailable] [20070126]
[  699.477066] ACPI Error (psparse-0551): Method parse/execution failed 
[\_SB_.AMW0.WMCA] (Node ffff810035e55400), AE_NOT_EXIST

The part of the DSDT we appear to be choking on is in \_SB.AMW0 (_HID 
PNP0C14):

OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)

(Followed by lots of Field() bits, which depend on the region RAM being 
defined).

Of course, in \_SB.PCI0.LPC0.EC0 (PNP0C09) we have exactly the same line, 
which works just fine:

OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)

So, I suspect either:

1) ACPICA does not handle EmbeddedControl outside of PNP0C09 (or, at least, 
can't handle it properly in PNP0C14, or in this case, *pnp0c14)

or

2) ACPICA is having a namespace clash with two identically named regions both 
trying to access EmbeddedControl? (But given that EC0 works fine, I'm not 
sure how likely this is).

Of course, if this bug is already known and has been fixed in something newer 
than 2.6.22, please let me know - I don't have the hardware in question, so 
cannot confirm this myself.

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

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

* RE: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-11-28  3:50 [ACPICA] EmbeddedControl region handling bug in PNP0C14 Carlos Corbacho
@ 2007-11-28 18:08 ` Moore, Robert
  2007-12-12 14:10   ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Moore, Robert @ 2007-11-28 18:08 UTC (permalink / raw)
  To: Carlos Corbacho, Linux-acpi, Len Brown; +Cc: Alexey Starikovskiy

This will probably require a trace.

Also, Alexey may have something to add.


>-----Original Message-----
>From: Carlos Corbacho [mailto:carlos@strangeworlds.co.uk]
>Sent: Tuesday, November 27, 2007 7:50 PM
>To: Linux-acpi@vger.kernel.org; Len Brown; Moore, Robert
>Subject: [ACPICA] EmbeddedControl region handling bug in PNP0C14
>
>The following is, I think, a bug in ACPICA (so CC'ing Robert Moore).
>
>(The full DSDT for the laptop in question (Acer Aspire 5040) is
available
>here - I'm just going to selectively quote from it in this e-mail:
>http://aceracpi.googlecode.com/svn/trunk/dsdt/acer/aspire/5040.dsl
>)
>
>ACPI is choking on the second of two OperationRegion's in different
parts
>of
>the DSDT, with the same name, and that both operate on the Embedded
>Controller.
>
>This hasn't cropped up before on the laptop in question (an Acer Aspire
>5040 -
>based on the DSDTs I've collected so far for Acer laptops, I suspect a
few
>others will have the same problem), as the second OperationRegion, in
this
>case, is found in \_SB.AMW0 (aka WMI-ACPI or PNP0C14); and in
acer_acpi,
>I've
>only just started poking at this (the first time by accident, the
second
>time
>by more closely studying the DSDT - unfortunately, I don't have the
>hardware
>in question).
>
>So, on the DSDT in question, we are trying to call \_SB.AMW0.WMCA
>
>In ACPI land, it takes three arguments:
>
>1) Instance (ACPI_TYPE_INTEGER)
>2) Method ID (ACPI_TYPE_INTEGER)
>3) Buffer (u32 in this case)
>
>When we call it (we already know what the correct values to pass are,
both
>from reverse engineering, and from visual inspection of the DSDT), we
>always
>get the following result (this is from a user with a 2.6.22 kernel):
>
>[  699.477048] ACPI Error (evregion-0316): No handler for Region [RAM_]
>(ffff8100012b7ac0) [EmbeddedControl] [20070126]
>[  699.477055] ACPI Error (exfldio-0289): Region EmbeddedControl(3) has
>no handler [20070126]
>[  699.477060] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While
>resolving operands for [OpcodeName unavailable] [20070126]
>[  699.477066] ACPI Error (psparse-0551): Method parse/execution failed
>[\_SB_.AMW0.WMCA] (Node ffff810035e55400), AE_NOT_EXIST
>
>The part of the DSDT we appear to be choking on is in \_SB.AMW0 (_HID
>PNP0C14):
>
>OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
>
>(Followed by lots of Field() bits, which depend on the region RAM being
>defined).
>
>Of course, in \_SB.PCI0.LPC0.EC0 (PNP0C09) we have exactly the same
line,
>which works just fine:
>
>OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
>
>So, I suspect either:
>
>1) ACPICA does not handle EmbeddedControl outside of PNP0C09 (or, at
least,
>can't handle it properly in PNP0C14, or in this case, *pnp0c14)
>
>or
>
>2) ACPICA is having a namespace clash with two identically named
regions
>both
>trying to access EmbeddedControl? (But given that EC0 works fine, I'm
not
>sure how likely this is).
>
>Of course, if this bug is already known and has been fixed in something
>newer
>than 2.6.22, please let me know - I don't have the hardware in
question, so
>cannot confirm this myself.
>
>-Carlos
>--
>E-Mail: carlos@strangeworlds.co.uk
>Web: strangeworlds.co.uk
>GPG Key ID: 0x23EE722D

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

* Re: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-11-28 18:08 ` Moore, Robert
@ 2007-12-12 14:10   ` Carlos Corbacho
  2007-12-12 15:44     ` Alexey Starikovskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-12-12 14:10 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Linux-acpi, Len Brown, Alexey Starikovskiy

On Wednesday 28 November 2007 18:08:44 Moore, Robert wrote:
> This will probably require a trace.

Here's the relevant ACPI error messages (with full ACPI debugging enabled) 
from acer_acpi, with some comments as to which method is 
being called and what arguments we're passing.

This user tested this on Kubuntu Gutsy (7.10) x86-64, with a custom 2.6.23.9 
kernel (basically, just the ACPI debugging enabled so we can get a better 
trace).

So, for reference, this is the DSDT we're working with:
http://files.strangeworlds.co.uk/5040.dsl

WMCA(1, 3, NULL):
[23375.726016] ACPI Error (evregion-0316): No handler for Region
[RAM_] (ffff81000132d1a0) [EmbeddedControl] [20070126]
[23375.726246] ACPI Error (exfldio-0289): Region EmbeddedControl(3)
has no handler [20070126]
[23375.726475] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While
resolving operands for [Store] [20070126]
[23375.726708] ACPI Error (psparse-0537): Method parse/execution
failed [\_SB_.AMW0.WMCA] (Node ffff8100013315f0), AE_NOT_EXIST

WMCA(1, 6, BUF(4 bytes) = 1):
[23444.490213] ACPI Error (evregion-0316): No handler for Region
[RAM_] (ffff81000132d1a0) [EmbeddedControl] [20070126]
[23444.490218] ACPI Error (exfldio-0289): Region EmbeddedControl(3)
has no handler [20070126]
[23444.490223] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While
resolving operands for [LGreater] [20070126]
[23444.490228] ACPI Error (psparse-0537): Method parse/execution
failed [\_SB_.AMW0.WMCA] (Node ffff8100013315f0), AE_NOT_EXIST
[23444.490263] acer_acpi:   In: 0x00000001

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-12-12 14:10   ` Carlos Corbacho
@ 2007-12-12 15:44     ` Alexey Starikovskiy
  2007-12-12 17:26       ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Starikovskiy @ 2007-12-12 15:44 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: Moore, Robert, Linux-acpi, Len Brown, Alexey Starikovskiy

_STA for EC is not needed -- might be worth trying to remove it

AnyAcc is not right -- should be ByteAcc.

OperationRegion EC01, EC02 also seem to be good recipe for trouble...


Carlos Corbacho wrote:
> On Wednesday 28 November 2007 18:08:44 Moore, Robert wrote:
>   
>> This will probably require a trace.
>>     
>
> Here's the relevant ACPI error messages (with full ACPI debugging enabled) 
> from acer_acpi, with some comments as to which method is 
> being called and what arguments we're passing.
>
> This user tested this on Kubuntu Gutsy (7.10) x86-64, with a custom 2.6.23.9 
> kernel (basically, just the ACPI debugging enabled so we can get a better 
> trace).
>
> So, for reference, this is the DSDT we're working with:
> http://files.strangeworlds.co.uk/5040.dsl
>
> WMCA(1, 3, NULL):
> [23375.726016] ACPI Error (evregion-0316): No handler for Region
> [RAM_] (ffff81000132d1a0) [EmbeddedControl] [20070126]
> [23375.726246] ACPI Error (exfldio-0289): Region EmbeddedControl(3)
> has no handler [20070126]
> [23375.726475] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While
> resolving operands for [Store] [20070126]
> [23375.726708] ACPI Error (psparse-0537): Method parse/execution
> failed [\_SB_.AMW0.WMCA] (Node ffff8100013315f0), AE_NOT_EXIST
>
> WMCA(1, 6, BUF(4 bytes) = 1):
> [23444.490213] ACPI Error (evregion-0316): No handler for Region
> [RAM_] (ffff81000132d1a0) [EmbeddedControl] [20070126]
> [23444.490218] ACPI Error (exfldio-0289): Region EmbeddedControl(3)
> has no handler [20070126]
> [23444.490223] ACPI Exception (dswexec-0462): AE_NOT_EXIST, While
> resolving operands for [LGreater] [20070126]
> [23444.490228] ACPI Error (psparse-0537): Method parse/execution
> failed [\_SB_.AMW0.WMCA] (Node ffff8100013315f0), AE_NOT_EXIST
> [23444.490263] acer_acpi:   In: 0x00000001
>
> -Carlos
>   


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

* Re: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-12-12 15:44     ` Alexey Starikovskiy
@ 2007-12-12 17:26       ` Carlos Corbacho
  2007-12-12 18:13         ` Alexey Starikovskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Corbacho @ 2007-12-12 17:26 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Moore, Robert, Linux-acpi, Len Brown, Alexey Starikovskiy

Alexey,

Is the code in EC0 interfering then with the EC access code in AMW0? (See 
lines 962 onwards for the AMW0 EmbeddedControl region bits)?

Because AFAICT, the EC0 code is fine (my 5020 has the same AML for EC0 and 
doesn't have any problem, and the user didn't report any other EC problems - 
we only see this problem when we try to use the EmbeddedControl region in 
AMW0).

-Carlos

-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

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

* Re: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-12-12 17:26       ` Carlos Corbacho
@ 2007-12-12 18:13         ` Alexey Starikovskiy
  2007-12-16  3:42           ` Carlos Corbacho
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Starikovskiy @ 2007-12-12 18:13 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: Moore, Robert, Linux-acpi, Len Brown, Alexey Starikovskiy

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

Carlos Corbacho wrote:
> Alexey,
>
> Is the code in EC0 interfering then with the EC access code in AMW0? (See 
> lines 962 onwards for the AMW0 EmbeddedControl region bits)?
>
> Because AFAICT, the EC0 code is fine (my 5020 has the same AML for EC0 and 
> doesn't have any problem, and the user didn't report any other EC problems - 
> we only see this problem when we try to use the EmbeddedControl region in 
> AMW0).
>
> -Carlos
>
>   
Please check if making AMW0' RAM an alias to EC0 one helps... See 
attachment.

[-- Attachment #2: a.diff --]
[-- Type: text/x-patch, Size: 3438 bytes --]

--- 5040.dsl	2007-12-12 21:03:04.000000000 +0300
+++ 5040a.dsl	2007-12-12 21:02:54.000000000 +0300
@@ -721,7 +721,7 @@
 
         Device (AMW0)
         {
-            Name (_HID, "*pnp0c14")
+            Name (_HID, "PNP0C14")
             Name (_UID, 0x00)
             Name (WLMP, 0x00)
             Name (B0ED, Buffer (0x04)
@@ -959,7 +959,8 @@
             CreateDWordField (CBE0, 0x00, BER4)
             CreateWordField (CBE0, 0x00, BUF0)
             CreateWordField (CBE0, 0x02, BER2)
-            OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
+//            OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
+            Alias(\_SB.PCI0.LPC0.EC0.RAM, RAM)
             Field (RAM, ByteAcc, Lock, Preserve)
             {
                 CMD0,   8, 
@@ -3614,7 +3615,7 @@
                     }
 
                     OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x0A), 
                             ,   1, 
@@ -3637,7 +3638,7 @@
                         BL2W,   1
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x01), 
                         TIID,   8, 
@@ -3664,19 +3665,19 @@
                         THS7,   8
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x92), 
                         KTAF,   8
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x92), 
                         THSL,   4
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0xD0), 
                         TSP0,   8, 
@@ -3985,7 +3986,7 @@
                         Notify (\_TZ.TZS1, 0x80)
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x02), 
                         NBID,   8, 
@@ -3997,14 +3998,14 @@
                         NB1A,   1
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0x88), 
                         NB0S,   8, 
                         NB1S,   8
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0xE0), 
                         BSRC,   16, 
@@ -4018,7 +4019,7 @@
                         BSBS,   8
                     }
 
-                    Field (RAM, AnyAcc, Lock, Preserve)
+                    Field (RAM, ByteAcc, Lock, Preserve)
                     {
                                 Offset (0xE0), 
                         BSDC,   16, 

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

* Re: [ACPICA] EmbeddedControl region handling bug in PNP0C14
  2007-12-12 18:13         ` Alexey Starikovskiy
@ 2007-12-16  3:42           ` Carlos Corbacho
  0 siblings, 0 replies; 7+ messages in thread
From: Carlos Corbacho @ 2007-12-16  3:42 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Moore, Robert, Linux-acpi, Len Brown, Alexey Starikovskiy

Actually, a bit of further reading suggests that this is my fault :(

The original ACPI error was quite correct - there is no EC region handler 
installed - because the EC handler is only installed for the EC device 
(PNP0C09), not WMI (PNP0C14).

Had I read through the EC code earlier I would have spotted that one. So, my 
apologies for wasting your time with this.

So, what I need to do is update WMI to install a handler for the 
EmbeddedControl region in PNP0C14.

Alexey - I suspect the easiest way would be to make such a handler just call 
ec_read & ec_write, and let the EC driver do the real work, rather than 
trying to do anything more complicated in WMI?

-Carlos

(Hoping WMI doesn't keep throwing up more "surprises"...)
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

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

end of thread, other threads:[~2007-12-16  3:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-28  3:50 [ACPICA] EmbeddedControl region handling bug in PNP0C14 Carlos Corbacho
2007-11-28 18:08 ` Moore, Robert
2007-12-12 14:10   ` Carlos Corbacho
2007-12-12 15:44     ` Alexey Starikovskiy
2007-12-12 17:26       ` Carlos Corbacho
2007-12-12 18:13         ` Alexey Starikovskiy
2007-12-16  3:42           ` Carlos Corbacho

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