Bug 17832 - Cannot display status of two batteries in lenovo thinkpad
Summary: Cannot display status of two batteries in lenovo thinkpad
Status: REJECTED DOCUMENTED
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-05 15:32 UTC by Hanno Boeck
Modified: 2010-11-04 00:42 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.35.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
GBST method with debug info (381 bytes, application/octet-stream)
2010-09-29 01:25 UTC, Zhang Rui
Details
GBST (381 bytes, application/octet-stream)
2010-10-09 07:09 UTC, Zhang Rui
Details
dmesg (1.28 KB, text/plain)
2010-10-10 21:00 UTC, Hanno Boeck
Details
bat-status (2.51 KB, text/plain)
2010-10-10 21:00 UTC, Hanno Boeck
Details
dmesg with bat1 discharging (1.28 KB, text/plain)
2010-10-11 14:46 UTC, Hanno Boeck
Details
bat status with bat1 discharging (2.51 KB, text/plain)
2010-10-11 14:46 UTC, Hanno Boeck
Details
dmesg with bat1 (/proc) discharging (3.85 KB, text/plain)
2010-10-15 09:06 UTC, Hanno Boeck
Details
bat status with bat1 (/proc) discharging (2.51 KB, text/plain)
2010-10-15 09:06 UTC, Hanno Boeck
Details

Description Hanno Boeck 2010-09-05 15:32:34 UTC
On my lenovo t61 laptop, I have an extra battery in the bay slot. I always can only see the status of one battery (no matter if through the old proc interface or the new one). See output of acpi:
Battery 0: Full, 100%
Battery 1: Unknown, 99%


It switches the battery it correctly shows, e.g. if bat1 is discharging, it shows bat1 correctly and bat0 as unknown, if bat0 is discharging then it's the other way round.

This is from dmesg:
ACPI: Battery Slot [BAT0] (battery present)
ACPI: Battery Slot [BAT1] (battery present)

From dmidecode:
Handle 0x0034, DMI type 22, 26 bytes
Portable Battery
	Location: Rear
	Manufacturer: SANYO
	Name: 42T4619
	Design Capacity: 84240 mWh
	Design Voltage: 10800 mV
	SBDS Version: 03.01
	Maximum Error: Unknown
	SBDS Serial Number: 1ECB
	SBDS Manufacture Date: 2010-06-23
	SBDS Chemistry: LION
	OEM-specific Information: 0x00000000

Handle 0x0035, DMI type 22, 26 bytes
Portable Battery
	Location: Bay
	Manufacturer: SONY
	Name: 51J0508
	Design Capacity: 31320 mWh
	Design Voltage: 10800 mV
	SBDS Version: 03.01
	Maximum Error: Unknown
	SBDS Serial Number: 05C5
	SBDS Manufacture Date: 2010-06-20
	SBDS Chemistry: LiP
	OEM-specific Information: 0x00000000


laverne hanno # acpi -V
Battery 0: Full, 100%
Battery 0: design capacity 2498 mAh, last full capacity 2498 mAh = 100%
Battery 1: Unknown, 99%
Battery 1: design capacity 6734 mAh, last full capacity 6859 mAh = 100%
Adapter 0: on-line
Thermal 0: ok, 45.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 100.0 degrees C
Thermal 0: trip point 1 switches to mode passive at temperature 95.5 degrees C
Thermal 1: ok, 50.0 degrees C
Thermal 1: trip point 0 switches to mode critical at temperature 127.0 degrees C
Cooling 0: LCD 0 of 15
Cooling 1: Processor 0 of 10
Cooling 2: Processor 0 of 10
Comment 1 ykzhao 2010-09-07 00:44:26 UTC
Will you please attach the output of acpidump on your box?

thanks.
Comment 2 Hanno Boeck 2010-09-08 16:54:03 UTC
You can find acpidump and other data at
http://int21.de/t61/data/
Comment 3 Zhang Rui 2010-09-14 01:37:12 UTC
please attach the output of "grep . /proc/acpi/battery/*/*".
Comment 4 Hanno Boeck 2010-09-14 10:41:20 UTC
/proc/acpi/battery/BAT0/alarm:alarm:                   4233 mWh
/proc/acpi/battery/BAT0/info:present:                 yes
/proc/acpi/battery/BAT0/info:design capacity:         84240 mWh
/proc/acpi/battery/BAT0/info:last full capacity:      84670 mWh
/proc/acpi/battery/BAT0/info:battery technology:      rechargeable
/proc/acpi/battery/BAT0/info:design voltage:          10800 mV
/proc/acpi/battery/BAT0/info:design capacity warning: 4233 mWh
/proc/acpi/battery/BAT0/info:design capacity low:     200 mWh
/proc/acpi/battery/BAT0/info:cycle count:		  0
/proc/acpi/battery/BAT0/info:capacity granularity 1:  1 mWh
/proc/acpi/battery/BAT0/info:capacity granularity 2:  1 mWh
/proc/acpi/battery/BAT0/info:model number:            42T4619
/proc/acpi/battery/BAT0/info:serial number:            7883
/proc/acpi/battery/BAT0/info:battery type:            LION
/proc/acpi/battery/BAT0/info:OEM info:                SANYO
/proc/acpi/battery/BAT0/state:present:                 yes
/proc/acpi/battery/BAT0/state:capacity state:          ok
/proc/acpi/battery/BAT0/state:charging state:          discharging
/proc/acpi/battery/BAT0/state:present rate:            17887 mW
/proc/acpi/battery/BAT0/state:remaining capacity:      52370 mWh
/proc/acpi/battery/BAT0/state:present voltage:         11503 mV
/proc/acpi/battery/BAT1/alarm:alarm:                   1566 mWh
/proc/acpi/battery/BAT1/info:present:                 yes
/proc/acpi/battery/BAT1/info:design capacity:         31320 mWh
/proc/acpi/battery/BAT1/info:last full capacity:      31320 mWh
/proc/acpi/battery/BAT1/info:battery technology:      rechargeable
/proc/acpi/battery/BAT1/info:design voltage:          10800 mV
/proc/acpi/battery/BAT1/info:design capacity warning: 1566 mWh
/proc/acpi/battery/BAT1/info:design capacity low:     200 mWh
/proc/acpi/battery/BAT1/info:cycle count:		  0
/proc/acpi/battery/BAT1/info:capacity granularity 1:  1 mWh
/proc/acpi/battery/BAT1/info:capacity granularity 2:  1 mWh
/proc/acpi/battery/BAT1/info:model number:            51J0508
/proc/acpi/battery/BAT1/info:serial number:            1477
/proc/acpi/battery/BAT1/info:battery type:            LiP
/proc/acpi/battery/BAT1/info:OEM info:                SONY
/proc/acpi/battery/BAT1/state:present:                 yes
/proc/acpi/battery/BAT1/state:capacity state:          critical
/proc/acpi/battery/BAT1/state:charging state:          charged
/proc/acpi/battery/BAT1/state:present rate:            0 mW
/proc/acpi/battery/BAT1/state:remaining capacity:      0 mWh
/proc/acpi/battery/BAT1/state:present voltage:         11081 mV
Comment 5 Hanno Boeck 2010-09-17 08:19:47 UTC
Status is still needinfo, it seems I cannot change that myself, please re-open, I've provided all information you've asked for.
Comment 6 Zhang Rui 2010-09-29 01:25:02 UTC
Created attachment 31822 [details]
GBST method with debug info

custom GBST method.

please
1. download this GBST.aml file
2. mount debugfs by "mount -t debugfs none /sys/kernel/debug"
3. override the old method via the debugfs by running
   "cat GBST.aml > /sys/kernel/debug/acpi/custom_method"
4. enable AML debug output by running
   "echo 1 > /sys/module/acpi/parameters/aml_debug_output"
5. dmesg -c
6. grep . /proc/acpi/battery/*/* >bat-status
7. dmesg > dmesg

and then please attach the bat-status and dmesg file here.
Comment 7 Hanno Boeck 2010-10-07 22:30:01 UTC
Which kenrel options do I need to enable to be able to use the aml file? I have the sysfs-interface, but I get 
laverne Downloads # cat GBST.aml > /sys/kernel/debug/acpi/custom_method 
cat: write error: Invalid argument

when I try to do that.
Comment 8 Zhang Rui 2010-10-08 05:27:33 UTC
so is /sys/kernel/debug/acpi/custom_method  available?
Comment 9 Hanno Boeck 2010-10-08 11:27:29 UTC
The interface file
/sys/kernel/debug/acpi/custom_method
exists but I can neither cat it nor cat something into it.
Comment 10 Zhang Rui 2010-10-09 07:09:51 UTC
Created attachment 32942 [details]
GBST
Comment 11 Zhang Rui 2010-10-09 07:10:34 UTC
would you please try the new GBST.aml file attached?
Comment 12 Hanno Boeck 2010-10-10 21:00:27 UTC
Created attachment 33132 [details]
dmesg
Comment 13 Hanno Boeck 2010-10-10 21:00:46 UTC
Created attachment 33142 [details]
bat-status
Comment 14 Zhang Rui 2010-10-11 01:35:22 UTC
please redo the test and attach the dmesg/bat-status when BAT1 is discharging.
Comment 15 Hanno Boeck 2010-10-11 14:46:30 UTC
Created attachment 33242 [details]
dmesg with bat1 discharging
Comment 16 Hanno Boeck 2010-10-11 14:46:45 UTC
Created attachment 33252 [details]
bat status with bat1 discharging
Comment 17 Zhang Rui 2010-10-13 00:28:58 UTC
(In reply to comment #16)
> Created an attachment (id=33252) [details]
> bat status with bat1 discharging

but this file shows that bat0 is still discharging, and bat1 is in critical status, i.e. the battery status doesn't change even if you switch the battery.
do I miss something?
Comment 18 Hanno Boeck 2010-10-13 09:39:09 UTC
What do you mean with switching the battery? I cannot switch them, they are two different kinds of batteries in different slots.
Comment 19 Zhang Rui 2010-10-14 00:35:21 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > Created an attachment (id=33252) [details] [details]
> > bat status with bat1 discharging
> 
> but this file shows that bat0 is still discharging, and bat1 is in critical
> status, i.e. the battery status doesn't change even if you switch the
> battery.
> do I miss something?

Sorry, I mean the battery status, i.e. the output of "grep . /proc/acpi/battery/*/*" is the same when bat0 is discharging and when bat1 is discharging.
Comment 20 Hanno Boeck 2010-10-15 09:06:29 UTC
Created attachment 33682 [details]
dmesg with bat1 (/proc) discharging

I think I found the reason for the confusion: the acpi command line tool shows the batteries in reverse order compared to the /proc-interface. So what I saw as bat1 was bat0 in proc.
Comment 21 Hanno Boeck 2010-10-15 09:06:52 UTC
Created attachment 33692 [details]
bat status with bat1 (/proc) discharging
Comment 22 Zhang Rui 2010-10-18 01:09:13 UTC
well, the HB1S value read from EC is 0x00 when the bat0 is unknown and is 0x44 when it's discharging.
This seems to be a firmware bug, and it should be described like this, bogus value got from firmware confuses the battery driver.
IMO, you'd better check if this has been fixed in the new BIOS/EC firmware.
Comment 23 Hanno Boeck 2010-11-03 19:02:27 UTC
I'm running latest BIOS available from lenovo.
Is there anything I can do about it? It makes the second battery pretty useless. Any idea how I should report this to Lenovo?
Comment 24 Zhang Rui 2010-11-04 00:42:08 UTC
do you have a windows partition on this laptop?
if yes, it would be great if you can verify if the problem exists in windows.

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