Bug 19022 - Kontron COMExpress-PC battery hotplugging not working
Summary: Kontron COMExpress-PC battery hotplugging not working
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-24 14:35 UTC by Marc Ferland
Modified: 2010-09-29 15:55 UTC (History)
1 user (show)

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


Attachments
disassmebled DSDT (344.22 KB, text/plain)
2010-09-24 14:40 UTC, Marc Ferland
Details
ADP1 info plugged (33 bytes, text/plain)
2010-09-24 14:41 UTC, Marc Ferland
Details
ADP1 info unplugged (34 bytes, text/plain)
2010-09-24 14:41 UTC, Marc Ferland
Details
acpidump (231.98 KB, text/plain)
2010-09-24 14:42 UTC, Marc Ferland
Details
battery info (no battery present) (168 bytes, text/plain)
2010-09-24 14:43 UTC, Marc Ferland
Details
battery info (one battery present) (776 bytes, text/plain)
2010-09-24 14:43 UTC, Marc Ferland
Details
battery info (two battery present) (1.36 KB, text/plain)
2010-09-24 14:43 UTC, Marc Ferland
Details
BIOS decode (1.21 KB, text/plain)
2010-09-24 14:44 UTC, Marc Ferland
Details
dmesg with i2c-i820 (47.68 KB, text/plain)
2010-09-24 14:45 UTC, Marc Ferland
Details
dmesg with i2c-scim (47.12 KB, text/plain)
2010-09-24 14:45 UTC, Marc Ferland
Details
dmidecode (13.87 KB, text/plain)
2010-09-24 14:46 UTC, Marc Ferland
Details
lspci -v output (7.32 KB, text/plain)
2010-09-24 14:46 UTC, Marc Ferland
Details
lspci -vxxx output (22.75 KB, text/plain)
2010-09-24 14:47 UTC, Marc Ferland
Details
acpi-interrupt-1 (3.92 KB, text/plain)
2010-09-27 15:55 UTC, Marc Ferland
Details
acpi-interrupt-2 (3.92 KB, text/plain)
2010-09-27 15:55 UTC, Marc Ferland
Details
dmesg (882 bytes, text/plain)
2010-09-27 15:55 UTC, Marc Ferland
Details
interrupts-1 (1.44 KB, text/plain)
2010-09-27 15:56 UTC, Marc Ferland
Details
interrupts-2 (1.44 KB, text/plain)
2010-09-27 15:56 UTC, Marc Ferland
Details
dmesg60 (5.17 KB, text/plain)
2010-09-27 16:05 UTC, Marc Ferland
Details

Description Marc Ferland 2010-09-24 14:35:50 UTC
I am working on a Kontron COMExpress-PC computer on module board. This board uses the MARS smart battery system from Kontron.

The status of the batteries is not updated when plugging or unplugging a battery.

I have to manually poll the /proc interface for update to happen. Batteries are correctly detected at boot time but not after unless I read /proc/acpi/battery/BAT[12]/*. 

From the MARS documentation users guide, I see that the COM SM-Bus is connected to the smart battery system manager which is an LTC1760 chip.

I've tried with different acpi_os_name and acpi_os with no luck.

I've also tried putting some printk's in the acpi_battery_notify and I can confirm that it is never called.

I've also noticed that the i2c-i820 module conflicts with a region claimed by ACPI. This region seems to be related to the battery system. Disabling the module removes the message but the batteries still aren't working as expected (I will put the dmesg of the kernel configured with i2c-i820 and i2c-scim).

See attached files for more information.
Comment 1 Marc Ferland 2010-09-24 14:40:21 UTC
Created attachment 31292 [details]
disassmebled DSDT
Comment 2 Marc Ferland 2010-09-24 14:41:27 UTC
Created attachment 31302 [details]
ADP1 info plugged
Comment 3 Marc Ferland 2010-09-24 14:41:50 UTC
Created attachment 31312 [details]
ADP1 info unplugged
Comment 4 Marc Ferland 2010-09-24 14:42:16 UTC
Created attachment 31322 [details]
acpidump
Comment 5 Marc Ferland 2010-09-24 14:43:01 UTC
Created attachment 31332 [details]
battery info (no battery present)
Comment 6 Marc Ferland 2010-09-24 14:43:25 UTC
Created attachment 31342 [details]
battery info (one battery present)
Comment 7 Marc Ferland 2010-09-24 14:43:48 UTC
Created attachment 31352 [details]
battery info (two battery present)
Comment 8 Marc Ferland 2010-09-24 14:44:15 UTC
Created attachment 31362 [details]
BIOS decode
Comment 9 Marc Ferland 2010-09-24 14:45:17 UTC
Created attachment 31372 [details]
dmesg with i2c-i820
Comment 10 Marc Ferland 2010-09-24 14:45:55 UTC
Created attachment 31382 [details]
dmesg with i2c-scim
Comment 11 Marc Ferland 2010-09-24 14:46:15 UTC
Created attachment 31392 [details]
dmidecode
Comment 12 Marc Ferland 2010-09-24 14:46:57 UTC
Created attachment 31402 [details]
lspci -v output
Comment 13 Marc Ferland 2010-09-24 14:47:22 UTC
Created attachment 31412 [details]
lspci -vxxx output
Comment 14 Zhang Rui 2010-09-27 02:27:03 UTC
please boot with the latest upstream kernel,
and do the following test:
1. echo 1 > /sys/module/acpi/aml_debug_output && dmesg -c
2. cat /proc/interrupts > interrupts-1 && grep . /sys/firmware/acpi/interrupts/* > acpi-interrupt-1
3. unplug or plug the battery
4. cat /proc/interrupts > interrupts-2 && grep . /sys/firmware/acpi/interrupts/* > acpi-interrupt-2 && dmesg > dmesg

and attach these five files here.
Comment 15 Marc Ferland 2010-09-27 15:55:02 UTC
Created attachment 31612 [details]
acpi-interrupt-1
Comment 16 Marc Ferland 2010-09-27 15:55:23 UTC
Created attachment 31622 [details]
acpi-interrupt-2
Comment 17 Marc Ferland 2010-09-27 15:55:47 UTC
Created attachment 31632 [details]
dmesg
Comment 18 Marc Ferland 2010-09-27 15:56:08 UTC
Created attachment 31642 [details]
interrupts-1
Comment 19 Marc Ferland 2010-09-27 15:56:28 UTC
Created attachment 31652 [details]
interrupts-2
Comment 20 Marc Ferland 2010-09-27 16:05:03 UTC
Created attachment 31662 [details]
dmesg60

A series of ACPI debug messages keep popping up in the log. See the attachment for an example.
Comment 21 Zhang Rui 2010-09-29 03:01:32 UTC
Bad news.
There is no interrupt when plugging/unplugging the battery...
By reading the AML code, GPE 07 should be fired when AC/Battery is plugged/unplugged, but it doesn't. I guess the AC adapter status is not changed neither when AC is plugged/unplugged, right?

This seems like an firmware problem to me and we can do nothing in Linux kernel to fix/workaround this.
BTW: IMO, windows should have the same problem. It would be great if you can verify this.
Comment 22 Marc Ferland 2010-09-29 15:55:50 UTC
(In reply to comment #21)
> Bad news.
> There is no interrupt when plugging/unplugging the battery...
> By reading the AML code, GPE 07 should be fired when AC/Battery is
> plugged/unplugged, but it doesn't. I guess the AC adapter status is not
> changed
> neither when AC is plugged/unplugged, right?
> 
Right plugging/unplugging the AC doesn't change it's status.

> This seems like an firmware problem to me and we can do nothing in Linux
> kernel
> to fix/workaround this.
> BTW: IMO, windows should have the same problem. It would be great if you can
> verify this.

The board manufacturer says it should work under windows but I haven't tested it.

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