You are not logged in.

#1 2019-08-21 13:19:45

sebirdman
Member
Registered: 2019-06-02
Posts: 5

[Thinkpad X1 Gen 2] Battery Information sometimes incorrect

Hello,

I'm noticing some strange behavior on my Thinkpad where the battery information is sometimes very incorrect. Primarily this seems to mostly effect three fields:

cat /sys/class/power_supply/BAT0/model_name
5B,/2%%0

cat /sys/class/power_supply/BAT0/manufacturer
Celxpert

cat /sys/class/power_supply/BAT0/energy_full       
120760000

the real energy_full shouldn't be higher than the design (which at least always seems correct):

cat /sys/class/power_supply/BAT0/energy_full_design
80400000


Sometimes the laptop boots up and all seems well (from what i can tell at least) and sometimes it boots up with this, which results in very different battery life estimates and sometimes will shutdown even when unnecessary.

My own next steps seem to be to look at the DSDT as described on the wiki: https://wiki.archlinux.org/index.php/DSDT but that seems like it could be quite a bit of a rabbit hole.

Any suggestions?

Last edited by sebirdman (2019-08-21 13:21:00)

Offline

#2 2019-08-22 01:12:25

sebirdman
Member
Registered: 2019-06-02
Posts: 5

Re: [Thinkpad X1 Gen 2] Battery Information sometimes incorrect

After messing around with DSDT I can't see any reason why it would be that. I compared my DSDT to a x1 carbon 6th gen and the battery portion of it (_BIF and _BIX) seem to be nearly the same.

If it is an issue with DSDT, then it's not very apparent what I would need to change.

Offline

#3 2019-08-22 03:08:28

sebirdman
Member
Registered: 2019-06-02
Posts: 5

Re: [Thinkpad X1 Gen 2] Battery Information sometimes incorrect

I'm not sure what the policy here is about continuing to respond to your own thread, but I've made some progress!

Booting into Ubuntu 19.04 and the battery info seems to be completely fine at kernel version 5.0.0! So somewhere along the there was a regression.

I'm building 5.0.0 arch kernel now. If that fixes it, then i'll have to start bisecting.

Offline

#4 2019-08-22 03:38:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [Thinkpad X1 Gen 2] Battery Information sometimes incorrect

Sorry I can't contribute to your actual issue, but I thought I could chime in on the following so you didn't feel completely ignored:

sebirdman wrote:

I'm not sure what the policy here is about continuing to respond to your own thread

Please do document any progress you are able to make on your own.  Your approach seems sound.  It is preferable, though, that if no one else has commented since your last post, that you use the "edit" button to append more information rather than continuing to add new sequential posts.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2019-08-22 05:46:34

sebirdman
Member
Registered: 2019-06-02
Posts: 5

Re: [Thinkpad X1 Gen 2] Battery Information sometimes incorrect

Good to know, thanks @Trilby

I've made some more progress. After compiling 5.0 for arch I was still having problems. That told me that it wasn't likely any code changes in the kernel. I grabbed all the power management options from the config file for ubuntu 19.04 and compiled the latest 5.2.9-arch1 with that.

After rebooting several times, I think i've got a fix! one of the following changes did it! Now to narrow that down...

diff --git a/repos/core-x86_64/config b/repos/core-x86_64/config
index 5e82b05..4037c22 100644
--- a/repos/core-x86_64/config
+++ b/repos/core-x86_64/config
@@ -490,7 +490,7 @@ CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
 CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
-CONFIG_PM_AUTOSLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
 CONFIG_PM_WAKELOCKS=y
 CONFIG_PM_WAKELOCKS_LIMIT=100
 CONFIG_PM_WAKELOCKS_GC=y
@@ -507,23 +507,23 @@ CONFIG_PM_GENERIC_DOMAINS=y
 CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
 CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
 CONFIG_PM_GENERIC_DOMAINS_OF=y
-CONFIG_ENERGY_MODEL=y
+# CONFIG_ENERGY_MODEL is not set
 CONFIG_ARCH_SUPPORTS_ACPI=y
 CONFIG_ACPI=y
 CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
-# CONFIG_ACPI_DEBUGGER is not set
+CONFIG_ACPI_DEBUGGER=y
 CONFIG_ACPI_SPCR_TABLE=y
 CONFIG_ACPI_LPIT=y
 CONFIG_ACPI_SLEEP=y
 # CONFIG_ACPI_PROCFS_POWER is not set
 CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
-CONFIG_ACPI_EC_DEBUGFS=y
-CONFIG_ACPI_AC=m
-CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_EC_DEBUGFS=m
+CONFIG_ACPI_AC=y
+CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
-CONFIG_ACPI_VIDEO=y
+CONFIG_ACPI_VIDEO=m
 CONFIG_ACPI_FAN=y
 CONFIG_ACPI_TAD=m
 CONFIG_ACPI_DOCK=y
@@ -534,9 +534,10 @@ CONFIG_ACPI_CPPC_LIB=y
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_IPMI=m
 CONFIG_ACPI_HOTPLUG_CPU=y
-CONFIG_ACPI_PROCESSOR_AGGREGATOR=y
+CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
 CONFIG_ACPI_THERMAL=y
 CONFIG_ACPI_NUMA=y
+CONFIG_ACPI_CUSTOM_DSDT_FILE=""
 CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
 CONFIG_ACPI_TABLE_UPGRADE=y
 CONFIG_ACPI_DEBUG=y
@@ -546,7 +547,7 @@ CONFIG_ACPI_HOTPLUG_MEMORY=y
 CONFIG_ACPI_HOTPLUG_IOAPIC=y
 CONFIG_ACPI_SBS=m
 CONFIG_ACPI_HED=y
-CONFIG_ACPI_CUSTOM_METHOD=m
+# CONFIG_ACPI_CUSTOM_METHOD is not set
 CONFIG_ACPI_BGRT=y
 # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
 CONFIG_ACPI_NFIT=m
@@ -559,17 +560,12 @@ CONFIG_ACPI_APEI_GHES=y
 CONFIG_ACPI_APEI_PCIEAER=y
 CONFIG_ACPI_APEI_MEMORY_FAILURE=y
 CONFIG_ACPI_APEI_EINJ=m
-CONFIG_ACPI_APEI_ERST_DEBUG=m
+# CONFIG_ACPI_APEI_ERST_DEBUG is not set
 CONFIG_DPTF_POWER=m
 CONFIG_ACPI_WATCHDOG=y
 CONFIG_ACPI_EXTLOG=m
 CONFIG_ACPI_ADXL=y
-CONFIG_PMIC_OPREGION=y
-CONFIG_CRC_PMIC_OPREGION=y
-CONFIG_XPOWER_PMIC_OPREGION=y
-CONFIG_BXT_WC_PMIC_OPREGION=y
-CONFIG_CHT_WC_PMIC_OPREGION=y
-CONFIG_CHT_DC_TI_PMIC_OPREGION=y
+# CONFIG_PMIC_OPREGION is not set
 CONFIG_ACPI_CONFIGFS=m
 CONFIG_TPS68470_PMIC_OPREGION=y
 CONFIG_X86_PM_TIMER=y

EDIT: it seems unlikely that any of the items that are just built in instead of being modules would cause the difference right?

EDIT2: So i'm not sure it's the kernel, but setting the battery to built in instead of module does seem to be the primary fix.

CONFIG_ACPI_BATTERY=y

The other thing that seems to work is adding the module directly to mkinitcpio.conf which would be a nice fix over having to compile a custom kernel.

EDIT3: after a few days of having battery in my minkinitcpio.conf the workaround seems to completely fixed the problem. I'm still curious as to what the actual cause is.

Last edited by sebirdman (2019-08-24 08:13:55)

Offline

Board footer

Powered by FluxBB