Bug 7466 - weird battery charge level reported - ACPI Error method parse / execution failed
Summary: weird battery charge level reported - ACPI Error method parse / execution failed
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Vladimir Lebedev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-07 11:19 UTC by Olivier Mondoloni
Modified: 2006-12-26 12:32 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.19-rc1 and above
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg display battery method parse execution error (12.12 KB, text/plain)
2006-11-07 11:20 UTC, Olivier Mondoloni
Details
dmidecode from mitac 8375 (11.89 KB, text/plain)
2006-11-07 11:21 UTC, Olivier Mondoloni
Details
acpidump from mitac 8375 (96.77 KB, text/plain)
2006-11-07 11:21 UTC, Olivier Mondoloni
Details
lspci -vv from mitac 8375 (8.60 KB, text/plain)
2006-11-07 11:22 UTC, Olivier Mondoloni
Details
proc interrupts from mitac 8375 (558 bytes, text/plain)
2006-11-07 11:23 UTC, Olivier Mondoloni
Details
dmesg with kernel parameter ec_intr=0 (12.18 KB, text/plain)
2006-11-14 15:25 UTC, Olivier Mondoloni
Details
dmesg with kernel parameter ec_intr=1 (12.13 KB, text/plain)
2006-11-14 15:27 UTC, Olivier Mondoloni
Details
Always re-enable GPE at exit from notify handler (674 bytes, patch)
2006-11-15 07:08 UTC, Alexey Starikovskiy
Details | Diff
dmesg from kernel patch ec (12.69 KB, text/plain)
2006-11-16 02:34 UTC, Olivier Mondoloni
Details
dmesg from ec 2.6.18 series on 2.6.19-rc5 (12.29 KB, text/plain)
2006-11-16 11:02 UTC, Olivier Mondoloni
Details
dmesg from 2.6.19-rc5 without defergloballock patch (12.52 KB, text/plain)
2006-11-17 11:34 UTC, Olivier Mondoloni
Details
2.6.19-rc5 dmesg 2.6.18 ec (patch -R) defergloballock (11.91 KB, text/plain)
2006-11-17 15:11 UTC, Olivier Mondoloni
Details
2.6.19-rc5 dmesg 2.6.18 ec (patch -R) defergloballock fix (15.19 KB, text/plain)
2006-11-18 08:52 UTC, Olivier Mondoloni
Details
2.6.19-rc5 dmesg with ec (comment#18) (5.12 KB, text/plain)
2006-11-19 20:46 UTC, Olivier Mondoloni
Details
Yield on deferred queue (3.59 KB, patch)
2006-11-20 03:34 UTC, Alexey Starikovskiy
Details | Diff
2.6.19-rc6-git2 dmesg with yield deferred queue patch (12.81 KB, text/plain)
2006-11-20 20:05 UTC, Olivier Mondoloni
Details
Changes to handling query events in EC (3.30 KB, patch)
2006-11-22 06:50 UTC, Alexey Starikovskiy
Details | Diff
2.6.19-rc6-git2 dmesg with mix patch (12.96 KB, text/plain)
2006-11-22 16:54 UTC, Olivier Mondoloni
Details
Make expect_event atomic and set it before writing to EC. (6.78 KB, patch)
2006-11-23 14:50 UTC, Alexey Starikovskiy
Details | Diff
2.6.19-rc6-git2 dmesg with expect event atomic patch (10.05 KB, text/plain)
2006-11-24 14:25 UTC, Olivier Mondoloni
Details
several ec evaluating from my computer (451 bytes, text/plain)
2006-11-27 09:31 UTC, Olivier Mondoloni
Details
kernel log since ec evaluating (347.27 KB, text/plain)
2006-11-27 09:33 UTC, Olivier Mondoloni
Details
Moved checks for completion around (12.49 KB, patch)
2006-11-27 11:59 UTC, Alexey Starikovskiy
Details | Diff
Patch for 19-rc6 (7.33 KB, patch)
2006-11-28 10:39 UTC, Alexey Starikovskiy
Details | Diff
Smaller patch (6.64 KB, patch)
2006-11-28 11:52 UTC, Alexey Starikovskiy
Details | Diff
kernel log (lastest patch applied) (63.69 KB, text/plain)
2006-11-29 04:24 UTC, Olivier Mondoloni
Details
proc acpi battery BAT0 info when the problem occured (425 bytes, text/plain)
2006-11-29 04:25 UTC, Olivier Mondoloni
Details
proc acpi battery BAT0 state when the problem occured (193 bytes, text/plain)
2006-11-29 04:26 UTC, Olivier Mondoloni
Details
proc acpi battery BAT0 right info (437 bytes, text/plain)
2006-11-29 04:28 UTC, Olivier Mondoloni
Details
proc acpi battery BAT0 right state (195 bytes, text/plain)
2006-11-29 04:29 UTC, Olivier Mondoloni
Details
Check for event arrived once again after timeout. (6.79 KB, patch)
2006-11-30 03:35 UTC, Alexey Starikovskiy
Details | Diff
kernel log with attachment #9644 ACPI_EC_DELAY=500 (17.13 KB, text/plain)
2006-11-30 12:08 UTC, Olivier Mondoloni
Details
kernel log with the lastest patch (17.43 KB, text/plain)
2006-12-01 08:01 UTC, Olivier Mondoloni
Details
kernel log with status patch without DELAY changes (13.99 KB, text/plain)
2006-12-04 09:28 UTC, Olivier Mondoloni
Details
Combined patch with increased ACPI_EC_DELAY (20.91 KB, patch)
2006-12-06 05:50 UTC, Alexey Starikovskiy
Details | Diff
kernel log related to combined patch with ec_delay #att9744 (17.17 KB, text/plain)
2006-12-07 10:40 UTC, Olivier Mondoloni
Details
kernel log related to combined patch with ec_delay #att9744 (20.91 KB, text/plain)
2006-12-09 14:47 UTC, Olivier Mondoloni
Details
stress load test program (49 bytes, text/plain)
2006-12-22 04:18 UTC, Olivier Mondoloni
Details
dmesg timer 250Hz from stress load program (15.10 KB, text/plain)
2006-12-22 04:20 UTC, Olivier Mondoloni
Details
kernel log from 10 mins of stress load prog 250Hz (14.38 KB, text/plain)
2006-12-24 08:38 UTC, Olivier Mondoloni
Details
kernel log from 10 mins of stress load prog 100Hz+patches (14.06 KB, text/plain)
2006-12-24 08:40 UTC, Olivier Mondoloni
Details

Description Olivier Mondoloni 2006-11-07 11:19:13 UTC
Most recent kernel where this bug did not occur: 2.6.18
Distribution: Gentoo Linux 2006.1
Hardware Environment: Notebook Mitac 8375
Software Environment: console
Problem Description: 
when the battery is charging, the level reported is completely weird like 819%.
Steps to reproduce:
compile 2.6.19-rc1 and above linux kernel, try to discharge the battery and
initiate after a charge.
Comment 1 Olivier Mondoloni 2006-11-07 11:20:22 UTC
Created attachment 9421 [details]
dmesg display battery method parse execution error
Comment 2 Olivier Mondoloni 2006-11-07 11:21:00 UTC
Created attachment 9422 [details]
dmidecode from mitac 8375
Comment 3 Olivier Mondoloni 2006-11-07 11:21:43 UTC
Created attachment 9423 [details]
acpidump from mitac 8375
Comment 4 Olivier Mondoloni 2006-11-07 11:22:25 UTC
Created attachment 9424 [details]
lspci -vv from mitac 8375
Comment 5 Olivier Mondoloni 2006-11-07 11:23:11 UTC
Created attachment 9425 [details]
proc interrupts from mitac 8375
Comment 6 Olivier Mondoloni 2006-11-07 11:24:37 UTC
I try to pass the acpi_serialize parameter at boot to my kernel but nothing change.

Thanks in advance.

Olivier
Comment 7 Vladimir Lebedev 2006-11-08 08:04:19 UTC
Please try the latest rc, 2.6.19-rc4 is available now.
Comment 8 Olivier Mondoloni 2006-11-08 09:10:53 UTC
I have already tested 2.6.19-rc4 linux kernel and the problem is still here.
Comment 9 Olivier Mondoloni 2006-11-10 13:19:02 UTC
Same problem with 2.6.19-rc5 linux kernel.
Comment 10 Vladimir Lebedev 2006-11-11 03:02:37 UTC
> Most recent kernel where this bug did not occur: 2.6.18

Can you confirm that 2.6.18 kernel works correctly?

Also, please try boot the latest kernel with ec_intr=0.
Comment 11 Olivier Mondoloni 2006-11-12 08:10:09 UTC
With ec_intr=0 as kernel parameter, my problem has gone.

Thanks

Olivier.

(no problem with 2.6.18 linux kernel)
Comment 12 Vladimir Lebedev 2006-11-13 05:59:50 UTC
> With ec_intr=0 as kernel parameter, my problem has gone.

Which kernel did you use? Is it possible to check the kernel 2.6.19-rc1?
Comment 13 Olivier Mondoloni 2006-11-13 08:16:19 UTC
It tested the ec_intr kernel parameter with 2.6.19-rc5.
Comment 14 Vladimir Lebedev 2006-11-13 10:26:53 UTC
Important: Is it possible to verify the kernel 2.6.19-rc1? I.e. the kernel 
2.6.19-rc1 fails with ec_intr=1 but works with ec_intr=0. Please send the 
dmesg of failure.
Comment 15 Olivier Mondoloni 2006-11-14 15:25:24 UTC
Created attachment 9512 [details]
dmesg with kernel parameter ec_intr=0

No problem for battery level.
Comment 16 Olivier Mondoloni 2006-11-14 15:27:21 UTC
Created attachment 9513 [details]
dmesg with kernel parameter ec_intr=1

No problem at all also with battery level. It seems strange.
Comment 17 Olivier Mondoloni 2006-11-14 15:28:30 UTC
This two dmesg come from 2.6.19-rc1 linux kernel.
Comment 18 Alexey Starikovskiy 2006-11-15 07:08:09 UTC
Created attachment 9522 [details]
Always re-enable GPE at exit from notify handler

Could you please try if this patch makes difference?
Comment 19 Olivier Mondoloni 2006-11-16 02:34:30 UTC
Created attachment 9528 [details]
dmesg from kernel patch ec

The battery level problem is back with ec_intr value as default (ec_intr in
interrupt mode). Look at my dmesg.
Tested with 2.6.19-rc5.
Comment 20 Vladimir Lebedev 2006-11-16 05:16:53 UTC
Please copy 2.6.18 drivers/acpi/ec.c to your 2.6.19-rc5 tree, recompile and 
verify the problem.
Comment 21 Olivier Mondoloni 2006-11-16 11:02:15 UTC
Created attachment 9532 [details]
dmesg from ec 2.6.18 series on 2.6.19-rc5

Something is strange. After the charging process of my battery, the level
reaches 100% which is normal but in my dmesg, I have ACPI errors related to EC,
AE_TIME.
Comment 22 Vladimir Lebedev 2006-11-17 05:06:21 UTC
This is for 2.6.19-rc5:
Please remove patch from bug 5534 comment 159 (don't defer release of global 
lock) i.e. patch -R ... and check the problem (I mean the battery state and 
error messages).
Please perform it for both ec.c - 2.6.18 and 2.6.19-rc5.
Thanks for the help.
Comment 23 Olivier Mondoloni 2006-11-17 11:34:30 UTC
Created attachment 9549 [details]
dmesg from 2.6.19-rc5 without defergloballock patch

Without the defergloballock patch and with the 2.6.19-rc5 ec, the battery level
is always weird with 849%. I am going to try 2.6.19-rc5 kernel with 2.6.18 ec.c
now.
Comment 24 Olivier Mondoloni 2006-11-17 15:11:15 UTC
Created attachment 9551 [details]
2.6.19-rc5 dmesg 2.6.18 ec (patch -R) defergloballock

I try this at the end:
patch -R defergloballock on my 2.6.19-rc5 kernel
2.6.18 ec.c on 2.6.19-rc5
The result is that battery level seems working because it shows when my battery

is charged 100% of the capacity (not a weird number like 819).
Comment 25 Olivier Mondoloni 2006-11-18 08:52:49 UTC
Created attachment 9559 [details]
2.6.19-rc5 dmesg 2.6.18 ec (patch -R) defergloballock fix

Today with the lastest patching procedure, I have ACPI error messages but the
battery level is good.
Sorry.
Comment 26 Vladimir Lebedev 2006-11-18 09:09:14 UTC
This is for 2.6.19-rc5:
Please remove patch defergloballock; ec.c should be from 2.6.19-rc5; please 
apply the patch from comment #18 (GPE in ec.c) and check the problem (dmesg, 
state)
Thanks.
Comment 27 Olivier Mondoloni 2006-11-19 20:46:40 UTC
Created attachment 9571 [details]
2.6.19-rc5 dmesg with ec (comment#18)

Always weird battery level(749%) and acpi errors (errors and exceptions).
Comment 28 Alexey Starikovskiy 2006-11-20 03:34:45 UTC
Created attachment 9573 [details]
Yield on deferred queue

Please try this patch on top of rc6-git2.
Comment 29 Olivier Mondoloni 2006-11-20 20:05:38 UTC
Created attachment 9579 [details]
2.6.19-rc6-git2 dmesg with yield deferred queue patch

Always acpi errors and exceptions messages but battery level reported is good
(100% of the capacity after a charging process).
Comment 30 Alexey Starikovskiy 2006-11-22 06:50:53 UTC
Created attachment 9590 [details]
Changes to handling query events in EC

Thanks, could you please add this patch to the mix?
Comment 31 Olivier Mondoloni 2006-11-22 16:54:46 UTC
Created attachment 9595 [details]
2.6.19-rc6-git2 dmesg with mix patch

Always ACPI errors and exceptions but battery level reported after charging
process is good (100%).
Comment 32 Alexey Starikovskiy 2006-11-23 14:50:47 UTC
Created attachment 9612 [details]
Make expect_event atomic and set it before writing to EC.

Please test if this patch makes difference...
Comment 33 Olivier Mondoloni 2006-11-24 14:25:48 UTC
Created attachment 9621 [details]
2.6.19-rc6-git2 dmesg with expect event atomic patch

Battery level appears to be good (100% of the capacity) but I always have acpi
errors and exceptions.

continue.
Comment 34 Alexey Starikovskiy 2006-11-27 05:43:38 UTC
Do you see any other evaluation of _Qxx methods after the "EC: evaluating 
_Q01" ?
Comment 35 Olivier Mondoloni 2006-11-27 09:25:36 UTC
I also had one day "EC: evaluating _Q09" .
Comment 36 Olivier Mondoloni 2006-11-27 09:31:02 UTC
Created attachment 9632 [details]
several ec evaluating from my computer
Comment 37 Olivier Mondoloni 2006-11-27 09:33:39 UTC
Created attachment 9633 [details]
kernel log since ec evaluating
Comment 38 Alexey Starikovskiy 2006-11-27 11:59:46 UTC
Created attachment 9634 [details]
Moved checks for completion around

Thanks,
Here is one more patch to test... If it does not help, could you try to change
EC_DELAY in the beginning of drivers/acpi/ec.c to 500?
Comment 39 Olivier Mondoloni 2006-11-28 06:08:16 UTC
What are the patches that they have to be applied on my kernel ?
Only the last one ?
On which kernel version ?
On 2.6.19-rc6, the last patch produces errors when I try to apply it.
Line 924 to be more precise.
Comment 40 Alexey Starikovskiy 2006-11-28 10:39:04 UTC
Created attachment 9641 [details]
Patch for 19-rc6

Sorry, my bad... Here is proper patch.
Comment 41 Alexey Starikovskiy 2006-11-28 11:52:56 UTC
Created attachment 9644 [details]
Smaller patch

This one should be better...
Comment 42 Olivier Mondoloni 2006-11-29 04:24:00 UTC
Created attachment 9651 [details]
kernel log (lastest patch applied)

The lastest patch to 2.6.19-rc6 kernel produces acpi errors and displays
battery level as null but my battery is 32%(when I reboot to a non-patched
kernel) at the moment when the problem occured.
Comment 43 Olivier Mondoloni 2006-11-29 04:25:45 UTC
Created attachment 9652 [details]
proc acpi battery BAT0 info when the problem occured
Comment 44 Olivier Mondoloni 2006-11-29 04:26:40 UTC
Created attachment 9653 [details]
proc acpi battery BAT0 state when the problem occured
Comment 45 Olivier Mondoloni 2006-11-29 04:28:04 UTC
Created attachment 9654 [details]
proc acpi battery BAT0 right info
Comment 46 Olivier Mondoloni 2006-11-29 04:29:02 UTC
Created attachment 9655 [details]
proc acpi battery BAT0 right state
Comment 47 Alexey Starikovskiy 2006-11-29 09:00:04 UTC
Could you try to change ACPI_EC_DELAY from 50 to 500 in the drivers/acpi/ec.c?
Comment 48 Olivier Mondoloni 2006-11-29 11:51:03 UTC
It's in testing.
Comment 49 Alexey Starikovskiy 2006-11-30 03:35:12 UTC
Created attachment 9672 [details]
Check for event arrived once again after timeout.

From you latest log it looks like interrupt did not arrive, while status value
did change. I added a check to always check status field, even if we did not
get an interrupt. Please try.
Comment 50 Olivier Mondoloni 2006-11-30 12:08:55 UTC
Created attachment 9691 [details]
kernel log with attachment #9644 [details] ACPI_EC_DELAY=500

It works great with ACPI_EC_DELAY=500 .
Nice job.
Comment 51 Alexey Starikovskiy 2006-11-30 13:08:56 UTC
Could you please put it under some stress load, like doing
------------------------------------
while true; do
cat /proc/acpi/battery/*/* &
cat /proc/acpi/thermal_zone/*/* &
done
------------------------------------
?
Comment 52 Alexey Starikovskiy 2006-11-30 14:29:56 UTC
Could you also check if delay increase helps without any patches?
Comment 53 Olivier Mondoloni 2006-12-01 08:01:58 UTC
Created attachment 9705 [details]
kernel log with the lastest patch

No problems at all with this patch under big stress load (heavy compilation of
programs). Battery level after charging is at 100% of its capacity with no acpi
errors.
Comment 54 Olivier Mondoloni 2006-12-02 12:50:36 UTC
Problem after complete charge of my battery.
"ACPI : read EC, IB not empty"
My battery is charged but it shows me 0% of the capacity.
Comment 55 Alexey Starikovskiy 2006-12-03 01:12:33 UTC
Is it the last past patch? Or is it unpatched kernel with only DELAY changes?
If you applied the patch, could you try to replace these back:
	if (!acpi_ec_check_status(ec, ACPI_EC_EVENT_IBF_0)) {
by
	status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
	if (status) {
Comment 56 Olivier Mondoloni 2006-12-03 12:22:43 UTC
I am going to try your change for status. My problem related to IB not empty
occured on a kernel with the lastest patch you have done.
Stay tune, I try your fix.
Comment 57 Olivier Mondoloni 2006-12-04 09:28:38 UTC
Created attachment 9734 [details]
kernel log with status patch without DELAY changes

I try your fix for status but without changing DELAY. I have ACPI errors and my
battery level is 849% of its capacity.
The kernel use is 2.6.19 with the lastest patch applied and status fix (but
without changing DELAY).
Comment 58 Alexey Starikovskiy 2006-12-06 05:50:22 UTC
Created attachment 9744 [details]
Combined patch with increased ACPI_EC_DELAY

It seems that increasing ACPI_EC_DELAY is always needed.
Here is a combined patch with already increased delay. Please test.
Comment 59 Olivier Mondoloni 2006-12-07 10:40:52 UTC
Created attachment 9758 [details]
kernel log related to combined patch with ec_delay #att9744

With the lastest patch (Attachement #9744), my laptop works flawlessly. My
battery level displayed is good (100% of its capacity). No acpi errors occured.

Great.
Comment 60 Olivier Mondoloni 2006-12-09 14:47:52 UTC
Created attachment 9771 [details]
kernel log related to combined patch with ec_delay #att9744

Today, it's very weird. I have acpi errors but the battery level is good (100%
of its capacity).
Sorry.
Comment 61 Olivier Mondoloni 2006-12-13 13:53:32 UTC
I try in my kernel config to change timer frequency 100 hz to 250 hz. It seems
that on a non patched kernel my level battery is working good. I try this
setting on 2.6.19.1 linux kernel (non patched). Timer frequency is the solution ?
I am going to use my notebook with this kernel during this week.

See you soon.
Comment 62 Olivier Mondoloni 2006-12-14 14:53:33 UTC
No problems, no acpi errors today with timer frequency 250 hz and no patched kernel.
Comment 63 Olivier Mondoloni 2006-12-19 14:02:07 UTC
Today no problems. Timer value at 250Hz seems to fix the problem (acpi errors).
I think you can close this bug report.
Comment 64 Vladimir Lebedev 2006-12-21 20:41:17 UTC
Please perform stress test on 250Hz and 100Hz kernels - run in a 
loop 'cat /proc/acpi/battery/*/*' for a long time concurrently and check dmesg 
on errors. Please post the full dmesg for both cases.
Comment 65 Olivier Mondoloni 2006-12-22 04:18:20 UTC
Created attachment 9925 [details]
stress load test program
Comment 66 Olivier Mondoloni 2006-12-22 04:20:14 UTC
Created attachment 9926 [details]
dmesg timer 250Hz from stress load program

just after 1 minute of program execution.
Comment 67 Vladimir Lebedev 2006-12-22 04:50:36 UTC
Thanks,

But, what about 100Hz + patches? I suggest test battery about 10 mins.

Comment 68 Olivier Mondoloni 2006-12-22 08:36:22 UTC
I would to test it but my kernel crash after just 1 minute of testing.
Comment 69 Vladimir Lebedev 2006-12-23 01:14:59 UTC
> I would to test it but my kernel crash after just 1 minute of testing.

Do you have any logs of crash?
Is it 100Hz kernel? And what about 10 min testing on 250Hz?
Comment 70 Olivier Mondoloni 2006-12-24 08:38:58 UTC
Created attachment 9943 [details]
kernel log from 10 mins of stress load prog 250Hz
Comment 71 Olivier Mondoloni 2006-12-24 08:40:08 UTC
Created attachment 9944 [details]
kernel log from 10 mins of stress load prog 100Hz+patches
Comment 72 Vladimir Lebedev 2006-12-26 12:32:56 UTC
> I think you can close this bug report.

Please reopen the bug if problem will appear in future kernel versions.

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