Created attachment 106809 [details]
Output of acpidump
The battery information reported in sysfs is wrong since kernel 2.6.34. In older versions the information is correct.
The affected device is a Samsung NP540U3C. The output of acpidump is attached.
These are the contents of /sys/class/power_supply/BAT1/uevent:
Correct information on 2.6.33:
Wrong information on 2.6.34:
v2.6.34 adds support for extended battery, I think that caused this problem, but I don't see why. Tianyu, maybe you have some idea.
Sorry for later response, could you check whether this issue takes place on the latest upstream kernel(v3.10)?
Yes, the problem occurs on kernel 3.10, as well.
How about unloading and then reloading acpi battery driver?
I tried unloading and loading the module battery, but that didn't change anything.
I only tried with kernel 3.9, though, as I don't have another kernel with the battery driver compiled as module right now. I can try again with 3.10 later.
There's no change either on 3.10 when unloading/reloading the battery module.
Created attachment 107031 [details]
Please try this patch.
With this patch applied, the battery info seems to be correct:
$ cat /sys/class/power_supply/BAT1/uevent
Yes, these info looks correct compared with the output from _BIF on 2.6.33. The _BIX is used instead of _BIF above 2.6.34. The parsing of _BIX is wrong in the acpi battery driver. I will send fix patch to acpi maillist. Thanks for test.
The fix patch has been merged into Linux upstream tree.
However this "fix" breaks the battery support for my laptop, a NEC LZ750/LS, logging the error:
[ 2.273992] ACPI Warning: For \_SB_.PCI0.LPCB.EC__.BAT1._BIX: Return Package is too small - found 19 elements, expected 20 (20121018/nspredef-679)
[ 2.274007] battery: probe of PNP0C0A:00 failed with error -14
Created attachment 110471 [details]
Output of acpidump on NEC LZ750/LS