Bug 8768 - ACPI battery power indicator jumps from $ACTUAL % to 0% and back
Summary: ACPI battery power indicator jumps from $ACTUAL % to 0% and back
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alexey Starikovskiy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-16 09:14 UTC by Christian Iversen
Modified: 2007-08-25 21:05 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.20-15-lowlatency (ubuntu 7.04)
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
ACPI dump of the offending laptop (25.66 KB, application/x-gzip)
2007-07-16 09:15 UTC, Christian Iversen
Details
Output of dmidecode for the laptop (27 bytes, application/x-gzip)
2007-07-16 09:16 UTC, Christian Iversen
Details
Sync battery accesses (2.26 KB, patch)
2007-07-17 02:14 UTC, Alexey Starikovskiy
Details | Diff
patch vs 2.6.23-rc1 (4.49 KB, patch)
2007-08-03 14:48 UTC, Len Brown
Details | Diff

Description Christian Iversen 2007-07-16 09:14:40 UTC
Most recent kernel where this bug did not occur: None that I know of
Distribution: Kubuntu 7.04
Hardware Environment: Zepto ZNote 4200/Compal CL56
Software Environment: 
Problem Description:

The problem was first described on linux-acpi@vger.kernel.org:

> My notebook is behaving somewhat oddly. The KDE battery indicator
> usually shows the right amount of battery power left, although every now
> and then, it jumps to a value in the range 0-10%, and then jumps back.
> This is quite annoying, because it gives of all sorts of warnings about
> imminent power failure.
> 
> I'm running kubuntu 7.04 with 2.6.20-15-generic from standard packages,
> on a Zepto 4200 (rebranded Compal CL56)
> 
> It _seems_ -- I'm not quite sure about the causality of this -- that the
> following error messages turn up in dmesg when the jump happens:
> 
> ...
> [577843.068000] ACPI Error (psparse-0537): Method parse/execution failed
> [\_SB_.PCI0.LPC0.BAT1._BST] (Node df853608), AE_NOT_FOUND
> [577843.068000] ACPI Exception (acpi_battery-0207): AE_NOT_FOUND,
> Evaluating _BST [20060707]
> [577873.068000] ACPI Error (psargs-0355): [PBST] Namespace lookup
> failure, AE_NOT_FOUND
> [577873.068000] ACPI Error (psparse-0537): Method parse/execution failed
> [\_SB_.PCI0.LPC0.BAT1._BST] (Node df853608), AE_NOT_FOUND
> [577873.068000] ACPI Exception (acpi_battery-0207): AE_NOT_FOUND,
> Evaluating _BST [20060707]
> [577903.080000] ACPI Error (psargs-0355): [PBST] Namespace lookup
> failure, AE_NOT_FOUND
> [577903.080000] ACPI Error (psparse-0537): Method parse/execution failed
> [\_SB_.PCI0.LPC0.BAT1._BST] (Node df853608), AE_NOT_FOUND
> [577903.080000] ACPI Exception (acpi_battery-0207): AE_NOT_FOUND,
> Evaluating _BST [20060707]
> [577933.076000] ACPI Error (psargs-0355): [PBST] Namespace lookup
> failure, AE_NOT_FOUND
> [577933.076000] ACPI Error (psparse-0537): Method parse/execution failed
> [\_SB_.PCI0.LPC0.BAT1._BST] (Node df853608), AE_NOT_FOUND
> [577933.076000] ACPI Exception (acpi_battery-0207): AE_NOT_FOUND,
> Evaluating _BST [20060707]
> [577963.068000] ACPI Error (psargs-0355): [PBST] Namespace lookup
> failure, AE_NOT_FOUND
> [577963.068000] ACPI Error (psparse-0537): Method parse/execution failed
> [\_SB_.PCI0.LPC0.BAT1._BST] (Node df853608), AE_NOT_FOUND
> [577963.068000] ACPI Exception (acpi_battery-0207): AE_NOT_FOUND,
> Evaluating _BST [20060707]
> ...
> 
> Maybe it has nothing to do with it? It seems to be battery-related, at
> least.
> 
> Is there something else I can do to help debug the cause of these error
> messages and/or the battery problem?
> 
> I've attached the output of dmidecode and acpidump, in case it's useful.

Steps to reproduce:

Simply run the computer without AC-power, and the problem will manifest itself.
Comment 1 Christian Iversen 2007-07-16 09:15:58 UTC
Created attachment 12054 [details]
ACPI dump of the offending laptop
Comment 2 Christian Iversen 2007-07-16 09:16:35 UTC
Created attachment 12055 [details]
Output of dmidecode for the laptop
Comment 3 Christian Iversen 2007-07-16 09:19:58 UTC
I forgot to mention - I have experienced the exact same problem on several older vanilla kernels. They didn't give very good acpi debug msgs though (acpi debug msg not enabled?), so I never quite could link the acpi errors with the battery indicator problem.

I have also confirmed that these errors do in fact happen at the exact same time that the power warning pops up. There seems to be a 1:1 correlation between acpi exception and power warning. Quite likely, the exception makes acpi report that the battery is 0% charged, which gives the warning.
Comment 4 Alexey Starikovskiy 2007-07-17 02:14:17 UTC
Created attachment 12060 [details]
Sync battery accesses

Please check if the attached patch make difference.
Comment 5 Christian Iversen 2007-07-21 16:17:10 UTC
I'm sorry, it doesn't. It doesn't even compile! ;-)

However, after patching the patch, with the following patch-patch, it works. And it works perfectly!

--- battery.c   2007-07-21 23:48:41.000000000 +0200
+++ battery.c~  2007-07-21 21:43:31.000000000 +0200
@@ -765,7 +765,7 @@
                                            acpi_battery_notify);

        acpi_battery_remove_fs(device);
-       mutex_destroy(&battery->lock);
+       mutex_destroy(&mutex->lock);
        kfree(battery);

        return 0;




(I hope CODE_FIX is the state for this bug report now?)
Comment 6 Christian Iversen 2007-07-21 16:18:09 UTC
Sorry, that patch was -R, but I'm 100% sure you get the point :-)
Comment 7 Alexey Starikovskiy 2007-07-23 09:13:56 UTC
Thanks :)
Comment 8 Len Brown 2007-07-25 23:25:07 UTC
patch applies to 2.6.22, but not to 2.6.23
Comment 9 Christian Iversen 2007-07-26 00:27:34 UTC
Does 2.6.23 not have this problem, or  does the fix not work for it?
Comment 10 Len Brown 2007-08-03 14:48:15 UTC
Created attachment 12241 [details]
patch vs 2.6.23-rc1

This refreshed patch from Alexey is applied to acpi-test.
Please verify it works with 2.6.23-rc1.
Comment 11 Vladimir Lebedev 2007-08-05 06:11:52 UTC
Len,

Patch from comment #10 is wrong.

 a) kernel memory can be corrupted - kfree/kzalloc of common data are called now without synchronization.

 b) I think this patch is not needed at all - the synchronization in 2.6.23 is done.

Please verify it works with latest 2.6.23-rc without patching.
Comment 12 Len Brown 2007-08-14 21:27:31 UTC
patch in comment #10 reverted from acpi-test
Comment 13 Len Brown 2007-08-25 21:05:57 UTC
patch in comment #10 reverted from 2.6.23-rc3-git9
closed.

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