Bug 14733 - [PATCH]Oops: ACPI: EC: input buffer is not empty, aborting transaction - 2.6.32 regression - Acer_Aspire_5730ZG
Summary: [PATCH]Oops: ACPI: EC: input buffer is not empty, aborting transaction - 2.6....
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: EC (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Lan Tianyu
URL:
Keywords:
: 42945 48221 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-04 14:09 UTC by Andrey Ovcharov
Modified: 2013-06-19 08:10 UTC (History)
24 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
all info gentoo-sources-2.6.32 (44.16 KB, text/plain)
2009-12-04 14:10 UTC, Andrey Ovcharov
Details
bug dmesg on gentoo-sources-2.6.32 (30.63 KB, text/plain)
2009-12-04 14:12 UTC, Andrey Ovcharov
Details
bug config-gentoo-sources-2.6.32 (71.58 KB, application/octet-stream)
2009-12-04 14:14 UTC, Andrey Ovcharov
Details
config-gentoo-sources-2.6.32 (71.56 KB, application/octet-stream)
2009-12-04 14:15 UTC, Andrey Ovcharov
Details
dmesg on gentoo-sources-2.6.32 (28.26 KB, text/plain)
2009-12-04 14:16 UTC, Andrey Ovcharov
Details
all info gentoo-sources-2.6.33-rc5 (51.12 KB, text/plain)
2010-01-24 13:48 UTC, Andrey Ovcharov
Details
kernel config-2.6.33-rc5 (77.02 KB, application/octet-stream)
2010-01-24 13:49 UTC, Andrey Ovcharov
Details
custom dsdt table (375.86 KB, text/x-chdr)
2010-01-24 13:49 UTC, Andrey Ovcharov
Details
dmesg-2.6.33-rc5 (261.45 KB, text/plain)
2010-01-24 13:50 UTC, Andrey Ovcharov
Details
dmesg-2.6.33 (714 bytes, application/x-gzip)
2010-02-25 14:01 UTC, pcxz
Details
This is full kernel message (81.42 KB, application/x-gzip)
2010-02-26 06:18 UTC, pcxz
Details
This is full kernel message without nvidia and ec.c in debug mode (84.02 KB, application/x-gzip)
2010-02-26 17:21 UTC, pcxz
Details
And this with timestamp in kernel (425.27 KB, application/x-gzip)
2010-02-26 19:29 UTC, pcxz
Details
Add delay before data write (489 bytes, patch)
2010-02-26 20:43 UTC, Alexey Starikovskiy
Details | Diff
Same problem after apply patch (711.05 KB, application/x-gzip)
2010-02-26 21:20 UTC, pcxz
Details
Add delay before data write, take #2 (476 bytes, patch)
2010-02-26 21:35 UTC, Alexey Starikovskiy
Details | Diff
custom kernel config for gentoo-sources-2.6.33 (with custom dsdt table) (18.08 KB, application/octet-stream)
2010-02-27 04:51 UTC, Andrey Ovcharov
Details
all info gentoo-sources-2.6.33 (8.20 KB, application/octet-stream)
2010-02-27 04:53 UTC, Andrey Ovcharov
Details
dmesg with error (18.18 KB, application/octet-stream)
2010-02-27 04:55 UTC, Andrey Ovcharov
Details
dmesg Evaluating _BST (25.77 KB, application/octet-stream)
2010-02-27 10:08 UTC, Andrey Ovcharov
Details
Add delay before data write, take #2 (1.60 KB, patch)
2010-02-27 15:35 UTC, Alexey Starikovskiy
Details | Diff
refreshed patch based on 2.6.38 (1.60 KB, patch)
2011-03-24 02:39 UTC, Zhang Rui
Details | Diff
dmesg on 3.1.0-rc4 kernel with error (19.05 KB, application/octet-stream)
2011-09-01 19:12 UTC, Andrey Ovcharov
Details
All info for patched-3.2.1-kernel+patched-dsdt (111.62 KB, application/octet-stream)
2012-01-18 20:18 UTC, Andrey Ovcharov
Details
All info for 3.2.1-vanilla-kernel (111.62 KB, application/octet-stream)
2012-01-18 20:20 UTC, Andrey Ovcharov
Details
All info for patched-3.2.1-kernel+patched-dsdt (76.33 KB, application/octet-stream)
2012-01-18 20:21 UTC, Andrey Ovcharov
Details
ec.diff patch (1.41 KB, patch)
2012-06-05 08:38 UTC, pcxz
Details | Diff
When search to poweroff or reboot (110.02 KB, text/plain)
2013-04-10 07:25 UTC, pcxz
Details
Dmesg full (55.69 KB, text/plain)
2013-04-10 19:30 UTC, pcxz
Details
Dmesg full with ec debug and also 10 minutes of work. (982.20 KB, text/plain)
2013-04-11 05:58 UTC, pcxz
Details
dmesg (444.20 KB, application/octet-stream)
2013-06-19 08:10 UTC, Vladimir Smirnov
Details

Description Andrey Ovcharov 2009-12-04 14:09:38 UTC
First of all kernels before 2.6.32 did not observe anything like that.

All necessary information about my hardware is here http://ru.gentoo-wiki.com/wiki/Acer_Aspire_5730ZG

In sys-kernel/vanilla-sources-2.6.32 and sys-kernel/gentoo-sources-2.6.32 after
loading the same symptoms: in the first place is not working brightness control
for display; second in dmesg watch spam

"ACPI: EC: input buffer is not empty, aborting transaction"

"ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.AMW0.WMCA]
(Node ffff8800bbc3f3e0), AE_TIME
ACPI: EC: input buffer is not empty, aborting transaction
ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl]
(20090903/evregion-424)"

the third is markedly reduced performance.

the spam in dmesg is very similar to this error
http://bugzilla.kernel.org/show_bug.cgi?id=13689

all-info* includes output of 
/usr/src/linux/scripts/ver_linux; cat /proc/cmdline; cat /proc/cpuinfo; cat /proc/modules; cat /proc/ioports; cat /proc/iomem; lspci -vvv; cat /proc/scsi/scsi

The solution was CONFIG_PM_RUNTIME = y
Comment 1 Andrey Ovcharov 2009-12-04 14:10:53 UTC
Created attachment 24018 [details]
all info gentoo-sources-2.6.32
Comment 2 Andrey Ovcharov 2009-12-04 14:12:09 UTC
Created attachment 24019 [details]
bug dmesg on gentoo-sources-2.6.32
Comment 3 Andrey Ovcharov 2009-12-04 14:14:06 UTC
Created attachment 24020 [details]
bug config-gentoo-sources-2.6.32
Comment 4 Andrey Ovcharov 2009-12-04 14:15:03 UTC
Created attachment 24021 [details]
config-gentoo-sources-2.6.32
Comment 5 Andrey Ovcharov 2009-12-04 14:16:08 UTC
Created attachment 24022 [details]
dmesg on gentoo-sources-2.6.32
Comment 6 Andrey Ovcharov 2009-12-04 14:57:43 UTC
with CONFIG_PM_RUNTIME = y still spam in dmesg as 

"ACPI: EC: input buffer is not empty, aborting transaction"

"ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.AMW0.WMCA]
(Node ffff8800bbc3f3e0), AE_TIME
ACPI: EC: input buffer is not empty, aborting transaction
ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl]
(20090903/evregion-424)"

But earned adjustment of monitor brightness!
Comment 7 Azraelle 2010-01-06 16:56:17 UTC
Confirmed. Got same errors with zen & arch linux kernels. Brightness adjustment works fine by default, i didn't change kernel params.

ACPI: EC: input buffer is not empty, aborting transaction
ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20090903/evregion-424)
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.AMW0.WMCA] (Node ffff88013f81a3a0), AE_TIME
Comment 8 Azraelle 2010-01-06 16:58:35 UTC
After reboot my laptop hangs up on bios tests, so i have to unplug ac and battery.
Comment 9 Stephane Travostino 2010-01-14 10:36:55 UTC
(In reply to comment #8)
> After reboot my laptop hangs up on bios tests, so i have to unplug ac and
> battery.

Same on my Acer Aspire 5930G. Using Archlinux and bug found at least till 2.6.32.2. Reverting back to 2.6.31 fixed the bug.

This is critical as I thought my laptop was broken as it wouldn't start, and the only solution seems to be unplugging AC and battery for a while.
Comment 10 Anonymous Emailer 2010-01-15 23:29:27 UTC
Reply-To: wes@uresu.com

HI all,

It seems I may be experiencing this problem.

http://www.mail-archive.com/acpi-bugzilla@lists.sourceforge.net/msg28491.html

Distro : Fedora 12
uname -r : 2.6.31.9-174.fc12.i686.PAE
Hardware : Acer Aspire 5735
Symptom1 : Brightness too low after wake-up
Symptom2 : wifi dying - the fastest recovery is a reboot
Symptom3 : like others I suspect the laptop was dead, the only recovery is
remove AC & Battery, hold down power button, insert AC, start up & replace
battery.

Is there anything I can provide or do to help?

Regards
Wes
Comment 11 Andrey Ovcharov 2010-01-24 13:47:31 UTC
In 2.6.33-r5(http://kernel.org/ mainline:	2.6.33-rc5	2010-01-21 ) everything exactly the same as it was in 2.6.32
I tried and with custom dsdt table... And without custom dsdt... 

Errors are the same as in 2.6.32:

not working brightness control for display;

spam in dmesg 
ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20091214/evregion-475)
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.BAT0._BST] (Node ffff8800bbf116d0), AE_TIME
ACPI Exception: AE_TIME, Evaluating _BST (20091214/battery-393)

for reboot need to unplugging battery
Comment 12 Andrey Ovcharov 2010-01-24 13:48:25 UTC
Created attachment 24693 [details]
all info gentoo-sources-2.6.33-rc5
Comment 13 Andrey Ovcharov 2010-01-24 13:49:02 UTC
Created attachment 24694 [details]
kernel config-2.6.33-rc5
Comment 14 Andrey Ovcharov 2010-01-24 13:49:32 UTC
Created attachment 24695 [details]
custom dsdt table
Comment 15 Andrey Ovcharov 2010-01-24 13:50:08 UTC
Created attachment 24696 [details]
dmesg-2.6.33-rc5
Comment 16 Len Brown 2010-01-28 00:27:37 UTC
> First of all kernels before 2.6.32 did not observe anything like that.

marking as 2.6.32 regression
Comment 17 Alessandro Zigliani 2010-02-12 07:27:59 UTC
(In reply to comment #0)
> First of all kernels before 2.6.32 did not observe anything like that.

This is strange. On gentoo I had the problem you describe with all kernel versions prior to 2.6.32. In fact I had to patch ec.c as described here: 
http://en.gentoo-wiki.com/wiki/Dell_Studio_1555#ACPI

With all gentoo kernel packages version 2.6.32 the problem is gone, but I get bug 14667 in exchange, which is much worse by the way. There is definitely something going on insidee the ACPI driver between 2.6.31 to 2.6.32...
Comment 18 pcxz 2010-02-13 13:17:33 UTC
Same problem here with all 2.6.32.* and, now tested, with 2.6.33rc8
Acer Aspire 5930G
Comment 19 pcxz 2010-02-25 14:00:04 UTC
Same problem with stable 2.6.33 kernel (stable? ..not work in thousands of computer and is out anyway?).

Please solve this problem is not possible this situation.
All notebook Acer user not have possibility to upgrade in new kernel? why?
Comment 20 pcxz 2010-02-25 14:01:52 UTC
Created attachment 25216 [details]
dmesg-2.6.33

Dmesg from 2.6.33 stable kernel.
Comment 21 Alexey Starikovskiy 2010-02-25 14:42:35 UTC
pcxz,
please post full dmesg, not the remains of it. /var/log/kern.log may have it.
Comment 22 pcxz 2010-02-26 06:18:10 UTC
Created attachment 25236 [details]
This is full kernel message
Comment 23 Alexey Starikovskiy 2010-02-26 12:06:10 UTC
pcxz,
I see something weird in your kernel.log: EC starts up fine, then both Battery and AC drivers start up fine too (they do several accesses of EC during their init). Then NVIDIA proprietary driver starts and there is some error from MXMI/MXMS handler routings. And only after that every call to EC fails.
Could you please check if not loading of NVIDIA driver helps?
Comment 24 Stephane Travostino 2010-02-26 16:41:54 UTC
@Alexey: if it may help, the MXMI/MXMS error appears on 2.6.31 too (don't remember previous versions though), but doesn't cause the hangups and errors people experience with 2.6.32 and later.

Here's the relevant lines in the kernel log:
ACPI Warning: \_SB_.PCI0.PEGP.VGA_.MXMI: Excess arguments - needs 1, found 2 20090521 nspredef-287
ACPI Warning: \_SB_.PCI0.PEGP.VGA_.MXMS: Excess arguments - needs 1, found 2 20090521 nspredef-287

I only get this error once, so I suspect it appears upon NVIDIA module loading.
Comment 25 Alexey Starikovskiy 2010-02-26 16:47:37 UTC
Ok, let's put NVIDIA into "irrelevant" category.
Please uncomment "#define DEBUG" in drivers/acpi/ec.c and enable printing of the timestamp in Kernel Debugging. Please attach full dmesg...
Comment 26 pcxz 2010-02-26 17:21:59 UTC
Created attachment 25247 [details]
This is full kernel message without nvidia and ec.c in debug mode

This is full kernel message without nvidia and ec.c in debug mode
Comment 27 Alexey Starikovskiy 2010-02-26 17:49:20 UTC
pcxz,
it's is not full. It starts when EC is already performing something and stops while there is no error yet...
Comment 28 pcxz 2010-02-26 19:29:31 UTC
Created attachment 25248 [details]
And this with timestamp in kernel

This kernel log is without nvidia with ec.c in debug mode and timestamp in kernel.

All log i send is after system is go in instable mode (micro freeze), temperature report 0° in all CPU (2 cpu), display light not work ecc..


I see after EC report 0x02 at infinite loop, computer is dead.
Comment 29 Alexey Starikovskiy 2010-02-26 20:43:16 UTC
Created attachment 25250 [details]
Add delay before data write

Please check if this patch changes anything. Please submit kernel.log as text/plain, without compressing it.
Comment 30 pcxz 2010-02-26 21:20:02 UTC
Created attachment 25251 [details]
Same problem after apply patch

No change sistuation, system go in instable mode (at any restart have to unplug ac and battery)

P.S.
Is impossible for me send kernel.log not compress ..exceed 1000kb permitted (my kernel.log is 13MB)
Comment 31 Alexey Starikovskiy 2010-02-26 21:35:13 UTC
Created attachment 25252 [details]
Add delay before data write, take #2

Let's increase delay.
Comment 32 pcxz 2010-02-26 22:20:03 UTC
Patch 2 seem work ok :) (30 minutes without problem) ..tomorrow test more time ..without and with nvidia module.

For now thx, very good (and fast) work.
Comment 33 Andrey Ovcharov 2010-02-27 04:51:30 UTC
Created attachment 25255 [details]
custom kernel config for gentoo-sources-2.6.33 (with custom dsdt table)
Comment 34 Andrey Ovcharov 2010-02-27 04:53:41 UTC
Created attachment 25256 [details]
all info gentoo-sources-2.6.33
Comment 35 Andrey Ovcharov 2010-02-27 04:55:02 UTC
Created attachment 25257 [details]
dmesg with error
Comment 36 Andrey Ovcharov 2010-02-27 05:03:37 UTC
This is without a patch. Nvidia module(x11-drivers/nvidia-drivers-190.53-r2 latest available on their website http://www.nvidia.ru/Download/index.aspx?lang=en) is loaded. 

Errors all the same.
Right now try to patch...
Comment 37 pcxz 2010-02-27 07:15:31 UTC
OK, for me this bug is solved with patch #2
With nvidia driver is ok, without nvidia driver is ok ...after suspend to ram resume ok.

Thx at Alexey Starikovskiy
Comment 38 Andrey Ovcharov 2010-02-27 07:21:59 UTC
Patch 2 is working for me!!! More than two hours and no errors! Even with the nvidia-drivers. brightness control works. restarts, too, as should normally restart (without unplug ac and battery) 

Thank you!
Comment 39 Andrey Ovcharov 2010-02-27 10:04:47 UTC
After 4 hours in dmesg is another error :

[16816.561291] ACPI: EC: input buffer is not empty, aborting transaction
[16816.561297] ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20091214/evregion-475)
[16816.561311] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.BAT0._BST] (Node ffff8800bbf016d0), AE_TIME
[16816.561363] ACPI Exception: AE_TIME, Evaluating _BST (20091214/battery-393)

brightness control not works.
Comment 40 Andrey Ovcharov 2010-02-27 10:08:37 UTC
Created attachment 25260 [details]
dmesg Evaluating _BST
Comment 41 Alexey Starikovskiy 2010-02-27 15:35:31 UTC
Created attachment 25261 [details]
Add delay before data write, take #2
Comment 42 Andrey Ovcharov 2010-02-28 06:12:09 UTC
With "Add delay before data write, take #2" looks like all fine for me.
Comment 43 pcxz 2010-03-02 12:47:56 UTC
Idem ..all fine same for me with "Add delay before data write, take #2"
Thx.
Comment 44 Stephane Travostino 2010-03-02 23:59:45 UTC
Running 64bit 2.6.32.9 with latest patch and seems to be OK for me too.
Comment 45 Zhang Rui 2010-03-12 02:03:08 UTC
Hi, alexey,

I got the similar problem and the patch in comment #41 fixes the bug for me.

And here are some feedbacks from the EC engineer, which I hope is useful for you.

> >> After our analysis of this issue, we found there the communication
> >> between Moblin OS (host) and EC might have some problems.
> >> 
> >> Currently, Moblin OS will send Read/Write ECRAM command to EC via
> >> 62h/66h I/O port, but it seems will not check IBF/OBF flag during the
> >> access.
> >> 
> >> That will cause OS sometimes will get the wrong data from EC or set
> >> the wrong data to EC.
> >> 
> >> You should follow the standard process as below:
> >> 
> >> Read/Write ECRAM by using 62h/66h I/O port:
> >> 66h (command/status port)
> >> Input (byte): Get EC status.
> >> Bit0: OBF (Output Buffer Full flag of EC)
> >> Bit1: IBF (Input Buffer Full flag of EC)
> >> Bit3: Command/Data Flag (0: Previous access port is data port/ 1:
> >> Previous access port is command port)
> >> Bit4: Burst enable flag
> >> Output (byte): command from host to EC
> >> 62h (data port)
> >> Input (byte): data from EC to host
> >> Output (byte): data from host to EC
> >> 
> >> Read ECRAM
> >> 
> >> 1.      wait both IBF & OBF = 0
> >> 2.      host write command 80h (EC_Read) to port 66h
> >> 3.      wait until IBF = 0 (wait EC firmware get the command)
> >> 4.      host write ECRAM index to port 62h
> >> 5.      wait until IBF = 0 and OBF = 1 (wait EC firmware get the index
> >> and prepare the result data to output buffer)
> >> 6.      host read data via port 62h
> >> 
> >> Write ECRAM
> >> 
> >> 1.      wait both IBF & OBF = 0
> >> 2.      host write command 81h (EC_Write) to port 66h
> >> 3.      wait until IBF = 0 (wait EC firmware get the command)
> >> 4.      host write ECRAM index to port 62h
> >> 5.      wait until IBF = 0  (wait EC firmware get the index)
> >> 6.      host write data via port 62h
> >> 7.      wait until IBF = 0 (wait EC firmware get the data)
> >> 
> >> Note: The process of Read/Write ECRAM should NOT be interrupted.
> >> (Should treat as a critical section)
> >> 
> >> Please check your S/W code and modify it to meet the standard EC
> >> access process.
Comment 46 Len Brown 2010-03-14 22:41:29 UTC
Rui,
Please list exactly what kernel (and version of the ec driver)
were being described in comment #45
Comment 47 Zhang Rui 2010-03-15 06:13:43 UTC
kernel version 2.6.32.4.
but it's linpus kernel rather than the vanilla kernel.
do you need the EC driver version?
Comment 48 Chuck Ebbert 2010-03-30 20:33:07 UTC
(In reply to comment #0)
> 
> the third is markedly reduced performance.
> 

The slow system performance is another symptom of:
  http://bugzilla.kernel.org/show_bug.cgi?id=14667

The fix for that is here now; it doubled the read speed of my SSD:
  http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Flenb%2Flinux-acpi-2.6.git;a=commitdiff_plain;h=dadf28a10c3eb29421837a2e41
Comment 49 colemarc 2010-04-14 11:24:10 UTC
People using Acer laptops may be interested to know that the problem went away (so far) after upgrading the BIOS from 1.19 to 1.23 on my 5930G.
Comment 50 Stephane Travostino 2010-04-14 11:28:07 UTC
@colemarc: No, I've always had v1.23 on my 5930G and I'm getting the issues. 

BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: V1.23          
        Release Date: 10/28/2008

I'm still running the patched 2.6.32.9, can't upgrade to 2.6.33 until this is fixed.
Comment 51 Azraelle 2010-04-14 12:55:43 UTC
And why don't you patch .33? I'm running .33 zen-kernel with this
patch and everything is ok.

On Wed, Apr 14, 2010 at 3:28 PM,  <bugzilla-daemon@bugzilla.kernel.org> wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=14733
>
>
>
>
>
> --- Comment #50 from Stephane Travostino <stephane.travostino@gmail.com> 
> 2010-04-14 11:28:07 ---
> @colemarc: No, I've always had v1.23 on my 5930G and I'm getting the issues.
>
> BIOS Information
>        Vendor: Phoenix Technologies LTD
>        Version: V1.23
>        Release Date: 10/28/2008
>
> I'm still running the patched 2.6.32.9, can't upgrade to 2.6.33 until this is
> fixed.
>
> --
> Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
>
Comment 52 Stephane Travostino 2010-04-14 13:49:46 UTC
@Azraelle: 2.6.32.9 is fine for me now. I had to upgrade due to 2.6.32 being a dependency of some newer packages in my distribution (Archlinux), otherwise I would've stayed with vanilla 2.6.31

I'll upgrade when it gets fixed in the vanilla code.
Comment 53 colemarc 2010-04-14 22:18:26 UTC
(In reply to comment #50)
> @colemarc: No, I've always had v1.23 on my 5930G and I'm getting the issues. 
> 
> BIOS Information
>         Vendor: Phoenix Technologies LTD
>         Version: V1.23          
>         Release Date: 10/28/2008

Sorry, indeed I was using "Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1" when the laptop run about 6 hours without issues (then I shut it down).
Went to "Ubuntu 2.6.32-20.30-generic 2.6.32.11+drm33.2" and the issue resurfaced after few minutes.
Now I am back to 2.6.32.10 to see if the problem stays away.

Someone noticed that even Windows complains about ACPI Embedded Controller, and in fact I sometime see this one in Windows 7 Event Viewer:
“The embedded controller (EC) did not respond within the specified timeout period. This may indicate that there is an error in the EC hardware or firmware or that the BIOS is accessing the EC incorrectly. You should check with your computer manufacturer for an upgraded BIOS. In some situations, this error may cause the computer to function incorrectly.”
Comment 54 colemarc 2010-04-16 20:06:57 UTC
(In reply to comment #53)
> Sorry, indeed I was using "Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1"
> when
> the laptop run about 6 hours without issues (then I shut it down).
> Went to "Ubuntu 2.6.32-20.30-generic 2.6.32.11+drm33.2" and the issue
> resurfaced after few minutes.
> Now I am back to 2.6.32.10 to see if the problem stays away.

And the problem stays away using Ubuntu 2.6.32-19.28-generic.
I have seen the issue using 2.6.32-20.X and 2.6.32-21.31.
Comment 55 Chuck Ebbert 2010-04-20 16:41:57 UTC
Fedora 13's 2.6.33 kernel has been stable with the patch from comment #41 applied.
Comment 56 pcxz 2010-05-18 06:18:40 UTC
Vanilla kernel 2.6.34 have same problem ..after apply patch at post #41 ..all ok :)

P.S.
why not add to stable kernel?
Comment 57 James Ettle 2010-06-03 20:02:06 UTC
The patch from comment #41 as applied to the F13 kernel breaks sleep button and lid events on the Clevo M720R notebook (which were previously fixed by the EC multibyte patches, see bug 14667).

See also: https://bugzilla.redhat.com/show_bug.cgi?id=599679
Comment 58 Stephane Travostino 2010-07-29 11:41:20 UTC
Any news? 2.6.34.1 is unusable without the patch. Is there a plan on how to solve this on future kernel versions?
Comment 59 Will Donnelly 2010-08-12 14:11:03 UTC
This fixes the issue with no noticeable side effects on my Aspire 5730Z running Archlinux as well.
Comment 60 James Ettle 2010-09-16 05:40:07 UTC
The patch disrupts ACPI on my notebook more than I'd first suspected, not only do I not get sleep/lid events, it prevents correct reading of the power and battery state.
Comment 61 ArathoN 2010-10-21 08:54:45 UTC
hi, i have the same problem with Maverick 10.10 with kernel 2.6.35.22, i tried to update the kernel to 2.6.36 but the problem persist, i also updated the bios and here the pc changed his behavior before it will hung at the screen boot (with the acer logo) now it try to load the system but at 1/3 ot the loading bar of the bios it crash and it try infinitely to load it again until i pull my battery and the ac/dc..
i noticed that before the errors appear i have always these two strings:
lo: Disabled Privacy Extensions
CE: hpet increased min_delta_ns to 11250 nsec

i don't know if they are related to the problem.

the patch listed above can i apply to the current kernel version?
(excuse me for my english -i'm italian- and i hope you'll solve this problem soon because i don't want to leave ubuntu)
Comment 62 Zhang Rui 2010-10-22 03:13:34 UTC
*** Bug 15560 has been marked as a duplicate of this bug. ***
Comment 63 James Ettle 2010-11-08 08:58:47 UTC
(In reply to comment #60)
> The patch disrupts ACPI on my notebook more than I'd first suspected

Patch continues to break things for me on 2.6.36.
Comment 64 Andrey Ovcharov 2010-11-21 09:11:20 UTC
sys-kernel/vanilla-sources-2.6.36 problem is still there. patch helps.
Comment 65 Andrey Ovcharov 2010-11-27 10:02:40 UTC
sys-kernel/vanilla-sources-2.6.37_rc3 The problem still exists.

patch is applied with errors:

# patch < acpi-ec-add-delay-before-write.patch
can't find file to patch at input line 7
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|https://bugzilla.kernel.org/show_bug.cgi?id=14733#c41
|
|diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
|index 27e0b92..09fbb69 100644
|--- a/drivers/acpi/ec.c
|+++ b/drivers/acpi/ec.c
--------------------------
File to patch: /usr/src/linux/drivers/acpi/ec.c
patching file /usr/src/linux/drivers/acpi/ec.c
Hunk #1 succeeded at 223 (offset -3 lines).
Hunk #2 succeeded at 231 (offset -3 lines).
Hunk #3 FAILED at 272.
1 out of 3 hunks FAILED -- saving rejects to file /usr/src/linux/drivers/acpi/ec.c.rej
Comment 66 Zhang Rui 2011-03-24 02:39:52 UTC
Created attachment 51862 [details]
refreshed patch based on 2.6.38

Hi, all,
does the problem still exists in the latest upstream kernel?
If yes, please apply this patch on top of 2.6.38 and see if it helps.
Comment 67 Chuck Ebbert 2011-03-24 22:02:42 UTC
(In reply to comment #66)
> does the problem still exists in the latest upstream kernel?
> If yes, please apply this patch on top of 2.6.38 and see if it helps.

That patch is in Fedora rawhide, and while it fixes the original problem it causes a new bug on some machines.  (See comment #57 and its link to the Fedora bug report.)
Comment 68 Stephane Travostino 2011-03-29 12:51:20 UTC
For sure this bug still affects 2.6.37.5 - I'm now running my laptop without battery and this bug is relevant only when a battery is inserted.

I don't have the chance to test with 2.6.38 though; I will update when possible.
Comment 69 rloth 2011-05-14 14:10:19 UTC
Situation:
==========

Hardware: Samsung R719 laptop (with broken touchpad, dont know if it's relevant)
Distribution : Ubuntu

For me the EC "buffer bla bla" error only appeared with an upgrade to 2.6.38. The boot is flooded with this message, usually hangs right there, sometimes goes on to gdm and freezes with no keyboard response. The computer has to be turned off by removing battery and power cord.

I didn't have the problem before I installed Ubuntu natty that ships with kernel version 2.6.38.

Also, these problems happen only after the *second boot after a non-patched install* ie the first boot is always fine?

-----

What I did:
===========

So I applied the ec.c patch provided by Zhang Rui in post #66 (kernel config unchanged apart from that, ie i used the generic-pae ubuntu flavour i got from the fresh install)

It does indeed remove the messages and the boot can proceed, but only to find that other things are now broken:
  - power events (ie cord unplug) trigger root partition remounts
  - keyboard sometimes becomes dead as before patch
  - xorg is unstable

I don't know if they are separate problems or not. I'll keep trying things and I'm usually posting in the downstream related bug for ubuntu (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/578506)
Comment 70 Martin Belohorka 2011-06-22 19:46:56 UTC
This bug has been in NEEDINFO status for a while now. What information is needed?
Comment 71 James Ettle 2011-08-25 23:39:13 UTC
Any further progress on getting a patch for this that doesn't break other systems? Any additional info needed?
Comment 72 Andrey Ovcharov 2011-08-28 13:36:59 UTC
For me, the patch is still needed on all cores from 2.6.32 to 3.1.0-rc3 (mainline 2011-08-22)

Fedora in git drop acpi-ec-add-delay-before-write.patch --> http://pkgs.fedoraproject.org/gitweb/?p=kernel.git;a=commit;h=0ad4e113ad7bda9e111ec5a306c3d4d0dc40d595
Comment 73 Andrey Ovcharov 2011-09-01 19:10:37 UTC
With 3.1.0-rc4 without patch the same problem…

ACPI: EC: input buffer is not empty, aborting transaction
ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20110623/evregion-478)
ACPI Error: Method parse/execution failed [\_SB_.AMW0.WMCA] (Node ffff8800ba23c730), AE_TIME (20110623/psparse-536)
Comment 74 Andrey Ovcharov 2011-09-01 19:12:06 UTC
Created attachment 71192 [details]
dmesg on 3.1.0-rc4 kernel with error
Comment 75 Zhang Rui 2012-01-18 01:54:09 UTC
It's great that kernel bugzilla is back.

can you please verify if the problem still exists in the latest upstream
kernel?
Comment 76 Andrey Ovcharov 2012-01-18 20:14:44 UTC
Bug still there. No significant changes. Further all the necessary information for two variants: vanilla-kernel, and patched-kernel + patched-dsdt.
Comment 77 Andrey Ovcharov 2012-01-18 20:18:11 UTC
Created attachment 72115 [details]
All info for patched-3.2.1-kernel+patched-dsdt

This https://github.com/init6/init_6/blob/master/sys-kernel/fc-sources/fc-sources-3.2.1.ebuild kernel with this https://github.com/init6/init_6/blob/master/sys-kernel/fc-sources/files/acpi-ec-add-delay-before-write.patch patch. Fixed dsdt in the archive.
Comment 78 Andrey Ovcharov 2012-01-18 20:20:39 UTC
Created attachment 72116 [details]
All info for 3.2.1-vanilla-kernel
Comment 79 Andrey Ovcharov 2012-01-18 20:21:31 UTC
Created attachment 72117 [details]
All info for patched-3.2.1-kernel+patched-dsdt
Comment 80 pcxz 2012-01-18 21:30:07 UTC
same problem still alive with all version of kernel <= 3.2.1
ec.patch solve problem.
Comment 81 Len Brown 2012-06-05 04:44:19 UTC
the link in comment #77 is broken.
please attach a copy of the patch that is working for you.
Comment 82 pcxz 2012-06-05 06:27:05 UTC
This patch work ok for me ( i named it ec.diff ):

[code]
--- drivers/acpi/ec.c	2011-01-05 01:50:19.000000000 +0100
+++ drivers/acpi/ec.c	2011-01-10 15:55:23.000000000 +0100
@@ -223,6 +223,7 @@
 				if (ec_transaction_done(ec))
 					return 0;
 			} else {
+				msleep(1);
 				if (wait_event_timeout(ec->wait,
 						ec_transaction_done(ec),
 						msecs_to_jiffies(1)))
@@ -230,8 +231,8 @@
 			}
 			advance_transaction(ec, acpi_ec_read_status(ec));
 		} while (time_before(jiffies, delay));
-		if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-			break;
+//		if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
+//			break;
 		pr_debug(PREFIX "controller reset, restart transaction\n");
 		spin_lock_irqsave(&ec->curr_lock, flags);
 		start_transaction(ec);
@@ -268,6 +269,15 @@
 	return (status & ACPI_EC_FLAG_IBF) == 0;
 }
 
+/* try to clean input buffer with burst_disable transaction */
+static int acpi_ec_clean_buffer(struct acpi_ec *ec)
+{
+	struct transaction t = {.command = ACPI_EC_BURST_DISABLE,
+				.wdata = NULL, .rdata = NULL,
+				.wlen = 0, .rlen = 0};
+	return acpi_ec_transaction_unlocked(ec, &t);
+}
+
 static int ec_wait_ibf0(struct acpi_ec *ec)
 {
 	unsigned long delay = jiffies + msecs_to_jiffies(ec_delay);
@@ -276,7 +286,8 @@
 		if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),
 					msecs_to_jiffies(1)))
 			return 0;
-	return -ETIME;
+//	return -ETIME;
+	return acpi_ec_clean_buffer(ec);
 }
 
 static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
[/code]
Comment 83 pcxz 2012-06-05 08:38:28 UTC
Created attachment 73510 [details]
ec.diff patch

 work with all 3.3.* version, apply ok also in 3.4.1
Comment 84 Lan Tianyu 2013-04-03 02:05:01 UTC
Hi  Andrey:
         Could you check whether this bug exists in the latest kernel? I don't see ec.patch has been upstream.
Comment 85 pcxz 2013-04-05 07:21:24 UTC
I use last 3.8.5 vanilla kernel compiled myself and this bug exist.
Patch ec.diff solve problem and i have to apply.
Comment 86 Jonathan Nieder 2013-04-07 22:02:19 UTC
Clearing moreinfo bit.

References: http://bugs.debian.org/704885
Comment 87 Lan Tianyu 2013-04-08 05:38:15 UTC
Hi, Please try the following patch. Thanks.

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 57c676a..d74fc63 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -666,16 +666,16 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
        if (function != ACPI_READ && function != ACPI_WRITE)
                return AE_BAD_PARAMETER;
 
-       if (EC_FLAGS_MSI || bits > 8)
-               acpi_ec_burst_enable(ec);
+//     if (EC_FLAGS_MSI || bits > 8)
+//             acpi_ec_burst_enable(ec);
 
        for (i = 0; i < bytes; ++i, ++address, ++value)
                result = (function == ACPI_READ) ?
                        acpi_ec_read(ec, address, value) :
                        acpi_ec_write(ec, address, *value);
 
-       if (EC_FLAGS_MSI || bits > 8)
-               acpi_ec_burst_disable(ec);
+//     if (EC_FLAGS_MSI || bits > 8)
+//             acpi_ec_burst_disable(ec);
 
        switch (result) {
        case -EINVAL:
Comment 88 Andrey Ovcharov 2013-04-08 07:48:40 UTC
I use all kernel 2.6.32 - 3.8.6 compiled myself and this bug still exist. In the past, this bug appeared rather constant but now it has become more difficult to reproduce. On latest 3.8.6 patch ec.diff from https://bugzilla.kernel.org/show_bug.cgi?id=14733#c83 still helps.

Now i try to test latest patch from you.
Comment 89 Lan Tianyu 2013-04-08 08:18:13 UTC
Ok. Thanks for your effort.
Comment 90 Lan Tianyu 2013-04-10 02:40:48 UTC
Is there any result ?
Comment 91 pcxz 2013-04-10 07:25:15 UTC
Created attachment 97951 [details]
When search to poweroff or reboot

Hi Lan Tianyu.

I test now your patch ..not work, when poweroff computer is sloooww and at restart not start, have to remove AC and unplug battery.
Comment 92 Andrey Ovcharov 2013-04-10 07:44:33 UTC
For my patch from https://bugzilla.kernel.org/show_bug.cgi?id=14733#c87 not help.

[ 7300.537036] ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20121018/evregion-501)
[ 7300.537056] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.GBST] (Node ffff8800bbc2fbe0), AE_TIME (20121018/psparse-537)
[ 7300.537074] ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_.BAT0._BST] (Node ffff8800bbc2fd70), AE_TIME (20121018/psparse-537)
[ 7300.537107] ACPI Exception: AE_TIME, Evaluating _BST (20121018/battery-492)
[ 7301.037042] ACPI: EC: input buffer is not empty, aborting transaction
[ 7301.037050] ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] (20121018/evregion-501)
[ 7301.037070] ACPI Error: Method parse/execution failed [\_SB_.PCI0.PEGP.VGA_.LCD_._BQC] (Node ffff8800bbc2ac58), AE_TIME (20121018/psparse-537)

All other like https://bugzilla.kernel.org/show_bug.cgi?id=14733#c8

So patch not help for my.
Comment 93 Lan Tianyu 2013-04-10 14:52:24 UTC
Hi  Andrey &  pcxz:
         Great thanks for your test. Could you provide dmesg with ec.c in debug mode and the following patch?

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d45b287..9fe9a37 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -242,7 +242,7 @@ static int ec_poll(struct acpi_ec *ec)
                        advance_transaction(ec, acpi_ec_read_status(ec));
                } while (time_before(jiffies, delay));
                if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-                       break;
+                       return -EAGAIN;
                pr_debug(PREFIX "controller reset, restart transaction\n");
                spin_lock_irqsave(&ec->lock, flags);
                start_transaction(ec);
@@ -255,19 +255,26 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
                                        struct transaction *t)
 {
        unsigned long tmp;
-       int ret = 0;
+       int ret = 0, count = 0;
+
        if (EC_FLAGS_MSI)
                udelay(ACPI_EC_MSI_UDELAY);
        /* start transaction */
        spin_lock_irqsave(&ec->lock, tmp);
        /* following two actions should be kept atomic */
        ec->curr = t;
+retry:
        start_transaction(ec);
        if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
                clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
        spin_unlock_irqrestore(&ec->lock, tmp);
        ret = ec_poll(ec);
        spin_lock_irqsave(&ec->lock, tmp);
+       if (ret == -EAGAIN && count < 10) {
+               pr_info("%s: retry %d \n", __func__, ++count);
+               goto retry;
+       }
+
        ec->curr = NULL;
        spin_unlock_irqrestore(&ec->lock, tmp);
        return ret;
Comment 94 pcxz 2013-04-10 19:30:53 UTC
Created attachment 98011 [details]
Dmesg full

This new patch work ok.
Attacched is full dmesg with ec debug.
Comment 95 Lan Tianyu 2013-04-11 04:18:31 UTC
Hi, Great to hear this. I see the log without ec debug info. I write a more simple patch. Please test it and attach the dmesg with ec debug opening . I write the open ec debug patch in the bottom. Thanks.

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d45b287..6376fd2 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -223,7 +223,7 @@ static int ec_check_sci_sync(struct acpi_ec *ec, u8 state)
 static int ec_poll(struct acpi_ec *ec)
 {
        unsigned long flags;
-       int repeat = 2; /* number of command restarts */
+       int repeat = 4; /* number of command restarts */
        while (repeat--) {
                unsigned long delay = jiffies +
                        msecs_to_jiffies(ec_delay);
@@ -241,8 +241,10 @@ static int ec_poll(struct acpi_ec *ec)
                        }
                        advance_transaction(ec, acpi_ec_read_status(ec));
                } while (time_before(jiffies, delay));
-               if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-                       break;
+
+               //if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
+               //      break;
+               pr_info(PREFIX "%s: repeat %d \n", __func__, 4 - repeat);
                pr_debug(PREFIX "controller reset, restart transaction\n");
                spin_lock_irqsave(&ec->lock, flags);
                start_transaction(ec);


Open ec debug patch.
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d45b287..34189f4 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -27,7 +27,7 @@
  */

 /* Uncomment next line to get verbose printout */
-/* #define DEBUG */
+#define DEBUG

 #include <linux/kernel.h>
 #include <linux/module.h>
Comment 96 pcxz 2013-04-11 05:58:17 UTC
Created attachment 98051 [details]
Dmesg full with ec debug and also 10 minutes of work.

Also this patch seem work ok, system restart well ..no problem.
Comment 97 Lan Tianyu 2013-04-12 01:52:59 UTC
*** Bug 15560 has been marked as a duplicate of this bug. ***
Comment 98 Lan Tianyu 2013-04-12 01:57:13 UTC
*** Bug 42945 has been marked as a duplicate of this bug. ***
Comment 99 Lan Tianyu 2013-04-12 02:52:54 UTC
*** Bug 48221 has been marked as a duplicate of this bug. ***
Comment 100 Lan Tianyu 2013-04-16 05:26:18 UTC
I will upstream the patch as soon as possible. Thanks for test.
Comment 101 Jonathan Nieder 2013-04-16 05:29:06 UTC
Thanks.  What information would you like from submitters?  (You set the state to NEEDINFO, which means you are waiting on information from them.)
Comment 102 Lan Tianyu 2013-04-16 05:53:20 UTC
No, actual info is needed. Just a habit, "assigned" maybe better. I change it.
Comment 103 Lan Tianyu 2013-05-06 05:43:42 UTC
Fix patch sent to acpi maillist.
https://patchwork.kernel.org/patch/2521951/
Comment 104 Lan Tianyu 2013-05-23 12:20:17 UTC
The patch has been merged into linux tree.

commit 28fe5c825f8e15744d04c7c1b8df197950923ecd
Author: Lan Tianyu <tianyu.lan@intel.com>
Date:   Mon May 6 03:23:40 2013 +0000

    ACPI / EC: Restart transaction even when the IBF flag set

    The EC driver works abnormally with IBF flag always set.
    IBF means "The host has written a byte of data to the command
    or data port, but the embedded controller has not yet read it".
    If IBF is set in the EC status and not cleared, this will cause
    all subsequent EC requests to fail with a timeout error.

    Change the EC driver so that it doesn't refuse to restart a
    transaction if IBF is set in the status.  Also increase the
    number of transaction restarts to 5, as it turns out that 2
    is not sufficient in some cases.
Comment 105 Vladimir Smirnov 2013-06-19 08:10:11 UTC
Created attachment 105331 [details]
dmesg

I've suddenly got same problem with Samsung NP900X3C. Upgrading to latest 3.9.6 doesn't help.

ACPI says that it's in status 0x12.

But patch from https://bugzilla.kernel.org/show_bug.cgi?id=14733#c82 helped.

I've attached dmesg from patched 3.9.6 kernel.

Note You need to log in before you can comment on or make changes to this bug.