Bug 81051 - Lenovo T440s - inserted battery not detected under hot swap
Summary: Lenovo T440s - inserted battery not detected under hot swap
Status: CLOSED INVALID
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Rafael J. Wysocki
URL:
Keywords:
: 117431 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-24 17:48 UTC by Michael Cox
Modified: 2016-05-11 10:38 UTC (History)
5 users (show)

See Also:
Kernel Version: 3.11.0-12-generic
Subsystem:
Regression: No
Bisected commit-id:


Attachments
gzipped acpidump output (115.67 KB, application/gzip)
2014-07-24 17:48 UTC, Michael Cox
Details
syslog after enabling acpi debug and performing 2nd battery undock and redock (47.74 KB, application/zip)
2015-01-06 17:27 UTC, Michael Cox
Details

Description Michael Cox 2014-07-24 17:48:19 UTC
Created attachment 144121 [details]
gzipped acpidump output

The Lenovo T440s ultrabook advertises a "powerbridge" facility.

It has two batteries the second of which can be removed and replaced without power down. 

Power is automatically switched to be taken first battery.

This all works fine on linux mint 16 except that when I remove the external battery I see an ACPI undock message in the logs:

Jun 17 22:10:46 mintpad kernel: [14318.961979] ACPI: 
\_SB_.PCI0.LPC_.EC__.BAT1: undocking

But when I replace the battery there is no docking message, no 
/sys/class/power_supply/BAT1 appears etc.

Cinnamon applets reporting battery status started to get terribly 
confused about how much power is left.

The only ways to force a re-detection are - hibernate/thaw, 
suspend/resume, shutdown/startup or plugging in the AC power.

Ideally hot swap should allow avoiding the first three of these and if I 
had AC power to hand I would not need an additional battery.

When I take one of these actions I do then see the message in the logs:

Jun 17 22:20:35 mintpad kernel: [14575.691824] ACPI: 
\_SB_.PCI0.LPC_.EC__.BAT1: docking

I'd love to find a fix or workaround for this bug. 

Any help appreciated.

PS

attached is the acpidump generated thus:

michael@mintpad ~/Documents/linux/acpidump $ sudo acpidump > t440s_acpidump.txt
[sudo] password for michael: 
Wrong checksum for FADT!
Comment 1 Zhang Rui 2014-08-25 03:11:14 UTC
please attach the dmesg out after battery plugged and inserted.
Comment 2 Michael Cox 2014-09-09 16:22:47 UTC
There seems to be no log output in /var/log/dmesg at all either when the battery is removed or when reinserted.

Syslog reports

Sep  9 17:18:31 mintpad kernel: [40097.205424] ACPI: Device does not support D3cold
Sep  9 17:18:31 mintpad kernel: [40097.205431] ACPI: \_SB_.PCI0.LPC_.EC__.BAT1: undocking

for undock and nothing for dock.
Comment 3 Michael Cox 2014-09-09 16:23:34 UTC
happy to try anything that might help diagnose...
Comment 4 Zhang Rui 2014-10-24 06:28:37 UTC
please make sure your kernel is built with CONFIG_ACPI_DEBUG set, and then reboot with boot option "acpi.debug_layer=0x04 acpi.debug_level=0x08000004", please unplug the battery, and then plug it again, and attach the dmesg output.
Comment 5 Zhang Rui 2014-12-03 05:04:45 UTC
ping...
Comment 6 Michael Cox 2014-12-03 08:22:36 UTC
Hi, 

I'm still here and still keen to get to the bottom of this and many thanks for your help thus far.

Never built a kernel before so need to do a bit of research on that.

Will get back to you as soon as I can

Michael
Comment 7 Michael Cox 2015-01-05 08:24:56 UTC
Sorry been busy.

I'm starting work on gathering the info today.
Comment 8 Michael Cox 2015-01-06 17:23:11 UTC
Information as requested.

I compiled a later kernel 3.11.1 as I could not find a kernel 3.11.0-12 to download.

I build and installed using the same config and set boot options and checked all was picked up:

michael@mintpad ~ $ uname -r | tee ~michael/Documents/acpi.txt
3.11.1
 
michael@mintpad ~ $ uname -v | tee ~michael/Documents/acpi.txt
#1 SMP Mon Jan 5 22:59:14 GMT 2015

michael@mintpad ~ $ cat /proc/cmdline | tee ~michael/Documents/acpi.txt
BOOT_IMAGE=/boot/vmlinuz-3.11.1 root=UUID=0ad1ca87-adfa-4137-9354-416dd19d55c4 ro quiet splash acpi.debug_layer=0x04 acpi.debug_level=0x08000004 vt.handoff=7

Heres the known batteries before the test:

michael@mintpad ~ $ ls /sys/class/power_supply/
AC  BAT0  BAT1

I then undocked the battery and redocked a few seconds afterward.

I noticed with 3.11.1 I do actually see an docked message now.

But the battery state is still not correct so the message must be ignored:

michael@mintpad ~ $ ls /sys/class/power_supply/
AC  BAT0

There was no change do the dmesg content during the test but I believe the debug output you requested is in the syslog which I zipped and attached.
Comment 9 Michael Cox 2015-01-06 17:27:05 UTC
Created attachment 162671 [details]
syslog after enabling acpi debug and performing 2nd battery undock and redock
Comment 10 Michael Cox 2015-01-06 17:44:59 UTC
I would add from further testing that the appearance of the ACPI docking message is not always guaranteed
Comment 11 Michael Cox 2015-01-06 18:47:40 UTC
I have made a discovery.

With the original kernel version if I push one of the sliding catches or open an close and can guarantee the docking message and the battery present message.

I think its dodgy hardware.
Comment 12 Michael Cox 2015-01-14 12:04:14 UTC
This was a hardware problem no software fix needed
Comment 13 Michael Niewoehner 2016-05-11 10:38:51 UTC
*** Bug 117431 has been marked as a duplicate of this bug. ***

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