Bug 1444

Summary: ACPI-1120: *** Error: Method execution failed ... AE_AML_BUFFER_LIMIT on Compaq X1005EA
Product: ACPI Reporter: Olivier Mondoloni (elgrande71)
Component: ACPICA-CoreAssignee: Len Brown (lenb)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, gurganbl
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.0-test9 Subsystem:
Regression: --- Bisected commit-id:
Attachments: acpidmp from 2.6.0-test9 kernel
dmesg from 2.6.0-test9 kernel
dmidecode from 2.6.0-test9 kernel
lspci -vv from 2.6.0-test9 kernel
/proc/interrupts from 2.6.0-test9 kernel
dmesg from 2.6.0-test8 kernel with patch from bug 1520
dmesg from 2.6.0-test9 with patch from bug 1520
dmesg from 2.6.0-test8 with 2nd patch from bug n
dmesg from 2.6.0-test9 with 2nd patch from bug n
a updated version
dmesg for n620c linux-2.6-test9 with patch (id=1427)
dmesg from 2.6.0-test9 kernel with 3rd patch
a proposal patch for fixing this issue
dmesg from 2.6.0-test9 kernel with lastest proposed patch
exstore.c modified (2.6.0-test10 kernel)
patch bug #1444 for testing
dmesg from 2.6.0-test11-bk8 with lastest official ACPI patch
acpidmp output
dmesg output
dmidecode output
/proc/interrupts output
lspci output

Description Olivier Mondoloni 2003-10-28 09:26:29 UTC
Distribution: Gentoo Linux 1.4
Hardware Environment: Compaq X1005EA
Software Environment: kernel boot and acpid
Problem Description: when I boot with the 2.6.0-test9 kernel, I have different
error messages related to acpi (AE_AML_BUFFER_LIMIT and at the end of the dmesg
file sleeping function error).

Steps to reproduce: Compile the 2.6.0-test9 kernel with default compilation option  
 with pay attention to not activate debug option of acpi.
Comment 1 Olivier Mondoloni 2003-10-28 09:27:20 UTC
Created attachment 1242 [details]
acpidmp from 2.6.0-test9 kernel
Comment 2 Olivier Mondoloni 2003-10-28 09:28:03 UTC
Created attachment 1243 [details]
dmesg from 2.6.0-test9 kernel
Comment 3 Olivier Mondoloni 2003-10-28 09:28:39 UTC
Created attachment 1244 [details]
dmidecode from 2.6.0-test9 kernel
Comment 4 Olivier Mondoloni 2003-10-28 09:29:30 UTC
Created attachment 1245 [details]
lspci -vv from 2.6.0-test9 kernel
Comment 5 Olivier Mondoloni 2003-10-28 09:30:21 UTC
Created attachment 1246 [details]
/proc/interrupts from 2.6.0-test9 kernel
Comment 6 Olivier Mondoloni 2003-10-28 09:35:21 UTC
I want to add something very important for me. I am not able to enter my
notebook in sleep mode with the following command : echo 1 > /proc/acpi/sleep .
My computer report good time remaining for using it on the battery for two
minutes after the boot but when I want to verify the time remaining after e.g.
ten minutes, it reports a wrong value like 30 minutes whereas I have 80% battery
capacity available.

Thank you in advance.

Olivier..
Comment 7 Len Brown 2003-10-28 09:53:29 UTC
same warnings as in bug #1404 -- a different Compaq laptop. 
 
    ACPI-1120: *** Error: Method execution failed [\_SB_.C046.C052] (Node cffbdc40), 
AE_AML_BUFFER_LIMIT 
    ACPI-1120: *** Error: Method execution failed [\_SB_.C046.C056] (Node cffbdc20), 
AE_AML_BUFFER_LIMIT 
    ACPI-1120: *** Error: Method execution failed [\_SB_.C046._CRS] (Node cffbdc00), 
AE_AML_BUFFER_LIMIT 
    ACPI-0098: *** Error: Method execution failed [\_SB_.C046._CRS] (Node cffbdc00), 
AE_AML_BUFFER_LIMIT 
 
Comment 8 Luming Yu 2003-11-09 18:22:01 UTC
Would you please try at http://bugzilla.kernel.org/show_bug.cgi?id=1520
Comment 9 Olivier Mondoloni 2003-11-10 08:14:20 UTC
Created attachment 1407 [details]
dmesg from 2.6.0-test8 kernel with patch from bug 1520
Comment 10 Olivier Mondoloni 2003-11-10 08:20:47 UTC
Created attachment 1408 [details]
dmesg from 2.6.0-test9 with patch from bug 1520

As you can see in the last two messages, the patch doesn't correct the problem.
I have a bunch of error messages related to acpi methods. In fact, usb devices
don't work at all, the battery is detected but my acpid daemon says that the
charge is null whereas the capacity of the battery wasn't null.

Olivier.
Comment 11 Luming Yu 2003-11-11 03:02:45 UTC
Thanks for your testing. I just update patch at bug 1520. And I hope you try it
again. The updated patch has 1 fix for error of replacing length of buffer. This
patch is try to fix bug of accessing region field through buffer. If there is no 
AE_AML_BUFFER_LIMIT, it means the patch works. Thanks a lot.
Comment 12 Olivier Mondoloni 2003-11-11 19:31:34 UTC
Created attachment 1413 [details]
dmesg from 2.6.0-test8 with 2nd patch from bug n
Comment 13 Olivier Mondoloni 2003-11-11 19:35:09 UTC
Created attachment 1414 [details]
dmesg from 2.6.0-test9 with 2nd patch from bug n
Comment 14 Luming Yu 2003-11-12 04:55:30 UTC
Created attachment 1427 [details]
a updated version

Maybe there are other things wrong in your DSDT. 
I want to look the ACPI debug information. Would you please try this patch with
ACPI_DEBUG option enabled.
Without this patch, C046.C052 will report AE_AML_BUFFER_LIMIT when accessing
7th object in C049.
Comment 15 Pierre Chifflier 2003-11-12 06:25:46 UTC
Created attachment 1428 [details]
dmesg for n620c linux-2.6-test9 with patch (id=1427)

I join this bug report: I have a compaq Evo N620C laptop which has a similar
problem (AE_AML_BUFFER_LIMIT)
This laptop does not really support APM so i'd really like to get ACPI working.

I tried several patches but nothing worked for the moment.
I precise that despite of these messages I can have the acpi state (acpi -V)
and all seems to work BUT I often get processes reading acpi state stuck in D
state after a moment (gkrellm, wmbattery or wmacpi). After that everything
trying to read /proc/acpi gets stuck too.
sleep states does not work either ...
As a programmer (not a kernel one, but i can learn ;) perhaps I can offer my
help too ?

Thanks
(attached: dmesg with latest proposed patch)
Comment 16 Olivier Mondoloni 2003-11-12 09:48:05 UTC
Created attachment 1429 [details]
dmesg from 2.6.0-test9 kernel with 3rd patch

I was obliged to use 2.6.0-test9 kernel with the latest acpi patch because of
the acpi debug bug 1341 that block the startup of my Linux system. I follow
your instructions and the results are in the following attachement.

Thanks, Olivier.
Comment 17 Robert Moore 2003-11-12 12:48:37 UTC
We need a trace of the following methods with debug enabled (acpi_dbg_level = 
0x00FFFFFF)

    ACPI-1120: *** Error: Method execution failed [\_SB_.C046.C052] (Node 
cffbdc40), 
AE_AML_BUFFER_LIMIT 
    ACPI-1120: *** Error: Method execution failed [\_SB_.C046.C056] (Node 
cffbdc20), 
AE_AML_BUFFER_LIMIT 
    ACPI-1120: *** Error: Method execution failed [\_SB_.C046._CRS] (Node 
cffbdc00), 
AE_AML_BUFFER_LIMIT 
    ACPI-0098: *** Error: Method execution failed [\_SB_.C046._CRS] (Node 
cffbdc00), 
AE_AML_BUFFER_LIMIT 
Comment 18 Olivier Mondoloni 2003-11-12 18:06:19 UTC
How do I trace these methods properly ?

Thanks
Olivier.
Comment 19 Luming Yu 2003-11-12 19:10:50 UTC
The below message appeared in your latest dmesg. This error is not what my 
patch try to address. It looks like a new one.

"dsopcode-0524 [19] ds_init_buffer_field  : Field size 1392 exceeds Buffer size 
1296 (bits)"

Comment 20 Luming Yu 2003-11-17 00:06:15 UTC
In your dsdt, there are something confusing me.
In method C056,
sizeof (C050) = 136
Buffer size of Local0 = 1296 (Your dmesg shows this value)
Obviously, 1296/8 - 136 = 26 = 1A
Obviously, C04D = 1
So below loop in C056 will only execute once.

                While (LLess (Local1, C04D))
                {
                    Store (C052 (Local0, Local2, Local1, Local3), Local2)
                    Increment (Local1)
                }

And Local0 is 1296-bits buffer,
Loca2 is sizeof(C050)-2 = 134
Local1 is sizeof(C050= 136
Local3 is 134 -26 = 108

In C052, before executing CreateDWord (Arg0, Local2 ..)
below two statements will be executed.
Store (Arg1, local2)
Add (Local2, 0xA, Loca2)

So, the local2 should be 134 + 10 =144 = 1152bits.
Obviously It should never fail to create a DWord in a 1296 bits from 1152bits
offset.

So, there must be something wrong in value of Arg1, which has been changed
somewhere.


Comment 21 Luming Yu 2003-11-17 00:42:17 UTC
Here is a small test case to exhabits this issue.
Method (C056, 0, NotSerialized)
{
Store (Buffer(0x6) {}, Local0)
C888(Local0, 2, 0, 0)
}


           Method (C888, 4, NotSerialized) {
                Store (Arg1, Local7)
                Store (Arg3, Local4)

                Add (Local4, 0x2, Local5)
                While (LLess (Local4, Local5))

      {Executing all Device _STA and_INI methods:.\_SB_._INI failed: AE_OK
.\_SB_.C00C._INI failed: AE_OK
.dsopcode-0526 [15] ds_init_buffer_field  : Field [C0EE] size 64 exceeds Buffer
[<NUL] size 48 (bits)
 psparse-1120: *** Error: Method execution failed [\_SB_.C888] (Node cfc53aa0),
AE_AML_BUFFER_LIMIT
 psparse-1120: *** Error: Method execution failed [\_SB_.C04B] (Node cfc5395c),
AE_AML_BUFFER_LIMIT
 psparse-1120: *** Error: Method execution failed [\_SB_.C046._INI] (Node
cfc53884), AE_AML_BUFFER_LIMIT
ment (Local4)
                        Increment (Local7)
                }
                Store (Arg1, Local7)
                CreateDWordField (Arg0, Local7, C0EE)
           }

In my testing machine, below message shows:
Comment 22 Luming Yu 2003-11-17 00:48:21 UTC
[I messed up above comments, repost it here]
Here is a small test case to exhabits this issue.

Method (C056, 0, NotSerialized)
{
Store (Buffer(0x6) {}, Local0)
C888(Local0, 2, 0, 0)
}


           Method (C888, 4, NotSerialized) {
                Store (Arg1, Local7)
                Store (Arg3, Local4)

                Add (Local4, 0x2, Local5)
                While (LLess (Local4, Local5))
               {
 
                        Increment (Local4)
                        Increment (Local7)
                }
                Store (Arg1, Local7)
                CreateDWordField (Arg0, Local7, C0EE)
           }
Comment 23 Luming Yu 2003-11-17 00:50:26 UTC
Dmesg error from my testing machine: (IBM T21)
.dsopcode-0526 [15] ds_init_buffer_field  : Field [C0EE] size 64 exceeds Buffer
[<NUL] size 48 (bits)
 psparse-1120: *** Error: Method execution failed [\_SB_.C888] (Node cfc53aa0),
AE_AML_BUFFER_LIMIT
 psparse-1120: *** Error: Method execution failed [\_SB_.C04B] (Node cfc5395c),
AE_AML_BUFFER_LIMIT
 psparse-1120: *** Error: Method execution failed [\_SB_.C046._INI] (Node
cfc53884), AE_AML_BUFFER_LIMIT
Comment 24 Luming Yu 2003-11-17 00:57:19 UTC
From above message, It is clear that , In current implementation of CA, 
store (Arg1, local7) will cause Arg1 and local7 reference same object.
So Add 2 to local7 will change Arg1 too. The second statement of " store (Arg1,
local7) " will not reset local7 to the initial value.
Comment 25 Luming Yu 2003-11-17 00:58:54 UTC
Created attachment 1453 [details]
a proposal patch for fixing this issue
Comment 26 Olivier Mondoloni 2003-11-17 06:37:45 UTC
Created attachment 1454 [details]
dmesg from 2.6.0-test9 kernel with lastest proposed patch

It seems that error messages have disappeared.

Good job. Thank you.

However, when I enter my laptop in sleep mode, it wake up immediatly. Why ?
(I use this command : echo 1 > /proc/acpi/sleep)

Thank you. Olivier.
Comment 27 Robert Moore 2003-11-21 15:50:45 UTC
I think this would be a better fix, it also handles the more general case:

    /*
     * If the reference count on the object is more than one, we must
     * take a copy of the object before we store.
     */
    if (ObjDesc->Common.ReferenceCount > 1)
    {
        Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
        ObjDesc = NewObjDesc;
        if (ACPI_FAILURE (Status))
        {
            return_ACPI_STATUS (Status);
        }
    }
Comment 28 Olivier Mondoloni 2003-11-22 01:13:32 UTC
Where should I place this fix, in which file ? Please.

Olivier.
Comment 29 Luming Yu 2003-11-25 17:07:44 UTC
*** Bug 1592 has been marked as a duplicate of this bug. ***
Comment 30 Olivier Mondoloni 2003-11-26 12:42:56 UTC
Thank you for response for comment #28.

Olivier.
Comment 31 Olivier Mondoloni 2003-11-27 02:53:23 UTC
For comment #27, where have I to place this fix ? In which file (exstore.c or
another) ? At which lines ?

Thank you
Comment 32 Luming Yu 2003-11-27 21:32:52 UTC
 Please add those code at drivers/acpi/executer/exstore.c @@ -167,6 +167,38 @@
Comment 33 Olivier Mondoloni 2003-11-28 07:12:57 UTC
Excuse me but I have a lot of compilling errors with the code submitted in
comment #27 (variables not defined, functions not recognized, etc...)

Thanks Olivier
Comment 34 Olivier Mondoloni 2003-11-28 09:15:35 UTC
Created attachment 1554 [details]
exstore.c modified (2.6.0-test10 kernel)

Is my exstore modified good? My kernel is compiling without errors. However, it
isn't working because my kernel crash at startup.
Could you help me please ?
Thanks, Olivier.
Comment 35 Olivier Mondoloni 2003-12-04 07:50:36 UTC
Created attachment 1628 [details]
patch bug #1444 for testing
Comment 36 Olivier Mondoloni 2003-12-04 07:54:19 UTC
Could you test this patch because I don't know if it's good or not.

Thank you.
Olivier.
Comment 37 Luming Yu 2003-12-04 19:32:06 UTC
Official patch has been merged into latest ACPI CA relase, and It will be found 
in the comming linux acpi patch release soon. 
Comment 38 Olivier Mondoloni 2003-12-12 12:07:30 UTC
I've tried the lastest official ACPI patch released today and my notebook works
great (no error messages related to ACPI now).

Thank you.
Olivier.
Comment 39 Olivier Mondoloni 2003-12-12 12:09:17 UTC
Created attachment 1659 [details]
dmesg from 2.6.0-test11-bk8 with lastest official ACPI patch

Good job. Really Thank you.

Olivier.
Comment 40 Brant Langer Gurganus 2003-12-15 18:22:19 UTC
With the latest patches on kernel 2.4.23, I have these same messages.  I will 
attach the command outputs requested on acpi.sourceforge.net 
 
Distribution: N/A (LFS 5.0) 
Hardware Environment: Compaq Evo N800w (latest BIOS) 
Software Environment: kernel boot 
Comment 41 Brant Langer Gurganus 2003-12-15 18:23:37 UTC
Created attachment 1673 [details]
acpidmp output
Comment 42 Brant Langer Gurganus 2003-12-15 18:24:21 UTC
Created attachment 1674 [details]
dmesg output
Comment 43 Brant Langer Gurganus 2003-12-15 18:24:52 UTC
Created attachment 1675 [details]
dmidecode output
Comment 44 Brant Langer Gurganus 2003-12-15 18:25:34 UTC
Created attachment 1676 [details]
/proc/interrupts output
Comment 45 Brant Langer Gurganus 2003-12-15 18:26:07 UTC
Created attachment 1677 [details]
lspci output
Comment 46 Len Brown 2003-12-16 22:55:52 UTC
Brant, 
actually, your dmesg show different messages for a different issue. 
Please file a new bug.  Closing the AE_AML_BUFFER_LIMIT bug. 
 
thanks, 
-Len 
 
Comment 47 Luming Yu 2003-12-17 03:07:20 UTC
Brant, 
I have made a patch to address your problem. please visit
http://bugzilla.kernel.org/show_bug.cgi?id=1690.

Thanks,
Luming
Comment 48 Brant Langer Gurganus 2004-01-22 13:50:35 UTC
As an FYI, I tried applying this patch to my kernel in addition to the one in bug 1690 and my 
kernel does not boot without acpi=off.