Bug 15999
Summary: | Remaining capacity is unknown after boot when fully charged on Benq R55 | ||
---|---|---|---|
Product: | ACPI | Reporter: | Vladislav Bogdanov (bubble) |
Component: | Power-Battery | Assignee: | Zhang Rui (rui.zhang) |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | acpi-bugzilla, rui.zhang |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.33.4 | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Attachments: |
Patch to solve battery issue on Benq R55
dmesg output acpidump output 'grep . /proc/acpi/battery/*/*' output 'grep . /proc/acpi/battery/*/*' output after AC unplug custom UPBS method |
Created attachment 26433 [details]
dmesg output
Created attachment 26434 [details]
acpidump output
Created attachment 26435 [details]
'grep . /proc/acpi/battery/*/*' output
(In reply to comment #0) > Everything worked fine on CentOS5 (2.6.18) but broke after upgrade to Fedora. > Now remaining capacity is shown as 'unknown' right after boot, but charging > state is 'charged'. So the problem only exists when AC is plugged and the battery is full charged, right? Please unplug the AC for a while and attach the output of "grep . /proc/acpi/battery/*/*" Created attachment 26632 [details]
'grep . /proc/acpi/battery/*/*' output after AC unplug
(In reply to comment #4) > So the problem only exists when AC is plugged and the battery is full > charged, > right? Yes. And only right after boot. If I unplug AC for several seconds (until KDE powerdevil shows green dashes) and then plug it back, then battery capacity is detected correctly until next reboot in all states (charged,charging,discharging). Attached is a battery state two seconds after AC unplug. This seems to be an AML code problem to me. This is the package that contains the battery status. Name (PBST, Package (0x04) { 0x00, 0xFFFFFFFF, 0xFFFFFFFF, /* battery remaining capacity */ 0x2710 }) And this is the AML code that returns the battery remaining capacity, If (LEqual (Local1, 0x01)) { If (And (0x04, \_SB.PCI0.LPCB.EC0.BATF)) { Store (\_SB.PCI0.LPCB.EC0.B1FC, Index (PBST, 0x02)) } Else { } } Else { Store (\_SB.PCI0.LPCB.EC0.MBRM, Index (PBST, 0x02)) } we can see that the battery remaining capacity field is not set in some cases(maybe the ACPI plugged && battery full charged case?) And battery remaining capacity 0xFFFFFFFF may be reported to OS in this case. To verify this, I'll attach a custom DSDT and it would be great if you can apply it and see if the problem goes away. Created attachment 26645 [details]
custom UPBS method
please boot a kernel that newer than 2.6.33.
mount debug fs.
run "cat custom_UPBS.hen > /sys/kernel/debug/acpi/custom_method".
and then see if the battery status is reported correctly.
custom UPBS ASL code:
DefinitionBlock ("", "UPBS", 1, "", "", 0x20080715)
{
External (\_SB_.BAT1.PBST, PkgObj)
External (\_SB_.POSW, MethodObj)
External (\_SB.PCI0.LPCB.EC0.MCUR)
External (\_SB.PCI0.LPCB.EC0.BFFG)
External (\_SB.PCI0.LPCB.EC0.BATF)
External (\_SB.PCI0.LPCB.EC0.B1FC)
External (\_SB.PCI0.LPCB.EC0.MBRM)
External (\_SB.PCI0.LPCB.EC0.BA1C)
External (\_SB.CM26)
External (\_SB.PCI0.LPCB.EC0.MBVG)
External (\_SB.PCI0.LPCB.EC0.MBTC)
Method (\_SB_.BAT1.UPBS, 0, NotSerialized)
{
Store (\_SB.PCI0.LPCB.EC0.MCUR, Local5)
Store (POSW (Local5), Index (PBST, 0x01))
Store (\_SB.PCI0.LPCB.EC0.BFFG, Local1)
If (LEqual (Local1, 0x01))
{
Store (\_SB.PCI0.LPCB.EC0.B1FC, Index (PBST, 0x02))
}
Else
{
Store (\_SB.PCI0.LPCB.EC0.MBRM, Index (PBST, 0x02))
}
Store (\_SB.PCI0.LPCB.EC0.BA1C, Local1)
Store (Local1, \_SB.CM26)
Store (\_SB.PCI0.LPCB.EC0.MBVG, Index (PBST, 0x03))
If (LNotEqual (Local5, 0x00))
{
If (\_SB.PCI0.LPCB.EC0.MBTC)
{
Store (0x02, Index (PBST, 0x00))
}
Else
{
Store (0x01, Index (PBST, 0x00))
}
}
Else
{
Store (0x00, Index (PBST, 0x00))
}
}
}
Hi, Are you sure about version? [root@localhost debug]# uname -a Linux localhost 2.6.34-20.fc14.i686.PAE #1 SMP Wed Jun 2 12:53:34 UTC 2010 i686 i686 i386 GNU/Linux [root@localhost debug]# pwd /sys/kernel/debug [root@localhost debug]# LANG=C ls -l total 0 drwxr-xr-x. 3 root root 0 Jun 5 09:45 ath5k drwxr-xr-x. 35 root root 0 Jun 5 09:45 bdi drwxr-xr-x. 3 root root 0 Jun 5 09:45 boot_params drwxr-xr-x. 4 root root 0 Jun 5 09:45 dri drwxr-xr-x. 2 root root 0 Jun 5 09:45 dynamic_debug -r--r--r--. 1 root root 0 Jun 5 09:45 gpio drwxr-xr-x. 3 root root 0 Jun 5 09:45 hid drwxr-xr-x. 3 root root 0 Jun 5 09:45 ieee80211 drwxr-xr-x. 2 root root 0 Jun 5 09:45 kprobes drwxr-xr-x. 2 root root 0 Jun 5 09:45 mce drwxr-xr-x. 2 root root 0 Jun 5 09:45 mmc0 -rw-r--r--. 1 root root 0 Jun 5 09:45 sched_features drwxr-xr-x. 2 root root 0 Jun 5 09:45 slow_work drwxr-xr-x. 6 root root 0 Jun 5 09:45 tracing drwxr-xr-x. 3 root root 0 Jun 5 09:45 usb drwxr-xr-x. 2 root root 0 Jun 5 09:45 virtio-ports drwxr-xr-x. 2 root root 0 Jun 5 09:45 x86 drwxr-xr-x. 4 root root 0 Jun 5 09:45 xen It seems that 2.6.34 doesn't have this feature yet. Oh, you need to set CONFIG_ACPI_DEBUG first. It seems to me that upgrade to the latest Intel's Verified reference BIOS for Quanta TW3A (which Benq R55E apparently is) platform solved this problem. Thanks for indirectly pointing me to a solution. |
Created attachment 26432 [details] Patch to solve battery issue on Benq R55 Everything worked fine on CentOS5 (2.6.18) but broke after upgrade to Fedora. Now remaining capacity is shown as 'unknown' right after boot, but charging state is 'charged'. Attached patch solves problem (copies last full capacity to remaining capacity).