1

I am running Ubuntu 17.10 on Lenovo Thinkpad w540. I have installed TLP and played with the battery charge thresholds. I have installed the acpi-call-dkms package to support the charging thresholds. But when I plug in the charger the battery is stuck at whatever charge it had. It will not charge anymore. I am attaching all the relevant information about my configuration. Please let me know if you need anything more specific.

This is when the charger is not plugged in:

--- TLP 1.0 --------------------------------------------

+++ ThinkPad Battery Features
tp-smapi   = inactive (unsupported hardware)
tpacpi-bat = active

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SANYO
/sys/class/power_supply/BAT0/model_name                     = 45N1779
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  99470 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  89260 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  54420 [mWh]
/sys/class/power_supply/BAT0/power_now                      =  22369 [mW]
/sys/class/power_supply/BAT0/status                         = Discharging

tpacpi-bat.BAT0.startThreshold                              =     15 [%]
tpacpi-bat.BAT0.stopThreshold                               =     95 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

Charge                                                      =   61.0 [%]
Capacity                                                    =   89.7 [%]
!
!

This is happening when plugged in:

--- TLP 1.0 --------------------------------------------

+++ System Info
System         = LENOVO ThinkPad W540 20BGCTO1WW
BIOS           = GNET84WW (2.32 )
Release        = Ubuntu 17.10
Kernel         = 4.14.13-041413-generic #201801101001 SMP Wed Jan 10 10:02:53 UTC 2018 x86_64
/proc/cmdline  = BOOT_IMAGE=/boot/vmlinuz-4.14.13-041413-generic root=UUID=d44e67d9-e678-43c1-8fdd-4a8ba00cbbfa ro quiet splash i915.modeset=1 nouveau.modeset=0 i8042.nonpnp=1 vt.handoff=7
Init system    = systemd v234
Boot mode      = UEFI

+++ TLP Status
State          = enabled
Last run       = 10:55:31 AM,     14 sec(s) ago
Mode           = AC
Power source   = AC
!
!
--- TLP 1.0 --------------------------------------------

+++ ThinkPad Battery Features
tp-smapi   = inactive (unsupported hardware)
tpacpi-bat = active

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SANYO
/sys/class/power_supply/BAT0/model_name                     = 45N1779
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  99470 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  89260 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  52630 [mWh]
/sys/class/power_supply/BAT0/power_now                      =      0 [mW]
/sys/class/power_supply/BAT0/status                         = Unknown (threshold effective)

tpacpi-bat.BAT0.startThreshold                              =     15 [%]
tpacpi-bat.BAT0.stopThreshold                               =     95 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

Charge                                                      =   59.0 [%]
Capacity                                                    =   89.7 [%]

This is my configuration:

--- TLP 1.0 --------------------------------------------

+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
TLP_DEFAULT_MODE=AC
TLP_PERSISTENT_DEFAULT=0
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
CPU_MIN_PERF_ON_AC=20
CPU_MAX_PERF_ON_AC=60
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=30
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
NMI_WATCHDOG=0
ENERGY_PERF_POLICY_ON_AC=normal
ENERGY_PERF_POLICY_ON_BAT=powersave
DISK_DEVICES="sda sdb"
DISK_APM_LEVEL_ON_AC="128 128"
DISK_APM_LEVEL_ON_BAT="128 128"
DISK_SPINDOWN_TIMEOUT_ON_BAT="180 180"
SATA_LINKPWR_ON_AC=min_power
SATA_LINKPWR_ON_BAT=min_power
AHCI_RUNTIME_PM_TIMEOUT=15
PCIE_ASPM_ON_AC=powersave
PCIE_ASPM_ON_BAT=powersave
WIFI_PWR_ON_AC=off
WIFI_PWR_ON_BAT=on
WOL_DISABLE=Y
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1
SOUND_POWER_SAVE_CONTROLLER=Y
BAY_POWEROFF_ON_AC=0
BAY_POWEROFF_ON_BAT=0
BAY_DEVICE="sr0"
RUNTIME_PM_ON_AC=auto
RUNTIME_PM_ON_BAT=auto
RUNTIME_PM_BLACKLIST="10de:11fc"
RUNTIME_PM_DRIVER_BLACKLIST="nouveau nvidia"
USB_AUTOSUSPEND=1
USB_BLACKLIST_BTUSB=0
USB_BLACKLIST_PHONE=0
USB_BLACKLIST_WWAN=1
RESTORE_DEVICE_STATE_ON_STARTUP=0
DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi"
DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
START_CHARGE_THRESH_BAT0=15
STOP_CHARGE_THRESH_BAT0=95
DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
4

Your actual threshold settings tell the battery controller to not charge when AC connected and charge level is between 15% and 95%. Currently your battery has 59%, so it works as designed and configured.

You may reset the thresholds temporarily with

sudo tlp fullcharge

or choose a more appropriate start threshold as explained in the FAQ or remove the thresholds completely by commenting the two config lines.

  • I have commented the setting in the config file but no effect. I purged the acpi-call-dkms package and still no effect. The problem is not that the battery charge is in the configured range, but that it will not charge. I went for lunch right now and had left the AC plugged in, but the charge is still 59%. Also I don't know if this is normal behavior but look at this: /sys/class/power_supply/BAT0/status = Unknown (threshold effective). – Prashant Desai Jun 28 '18 at 17:34
  • +1 I've wondered about this myself but not enough to investigate. – WinEunuuchs2Unix Jun 28 '18 at 17:36
  • When I check the status of my system using sudo tlp-stat --battery the battery status shows unknown. This is after commenting the 2 lines in the config file and purging the acpi-call-dkms package. /sys/class/power_supply/BAT0/status = Unknown Charge = 59.0 [%] Capacity = 89.7 [%] – Prashant Desai Jun 28 '18 at 17:43
  • After reading the linerunner.de page about TLP, I learned that you can temporarily set your charge to the upper threshold. So for example, if your threshold is [40 60], and your battery is at a level between the two, you can use the command sudo tlp chargeonce. This will raise the lower threshold to upperthreshold - 4 so that it will begin charging. What I am confused about is what is happening to your battery when you are in the configured range? I do not see the battery level drop even by one percent while plugged in? How can this be true? – Prashant Desai Jun 28 '18 at 18:13
  • Your answer makes sense linrunner. I feel dumb today. – Prashant Desai Jun 28 '18 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.