Battery Care

What is “Battery Life”?

  • Battery life is the amount of time your device runs before it needs to be recharged, it’s also called battery runtime. It’s the task of TLP’s power saving features to extend it.

  • In contrast battery lifespan is the amount of time your battery lasts until it needs to be replaced. This is where battery care comes in.

What is “Battery Care”?

In Version 1.3 and below it is called “Battery Features”.

Battery care aims to extend the lifespan of the battery by reducing wear and capacity loss resulting from ongoing operation. This can be achieved by:

  1. Limiting the maximum charge level to below 100% (stop charge threshold)

  2. Preventing the charging process from continuing as soon as the charger is connected after a short discharge (start charge threshold)

  3. Recalibration helps keep the charge level readings and battery runtime estimates accurate by setting new “full charge” and “full discharge” anchors in the battery controller.

Battery care does not involve additional power saving.

How does it work?

The process of battery charging is not directly controlled by TLP, but by the embedded controller (EC) of your laptop. This makes the process work even when the laptop is switched off or no operating system is running. The contribution of TLP is to write the threshold values into the corresponding control registers of the EC using a hardware specific kernel driver.

The charging process is determined by the charge thresholds:

  • Start charge threshold (START_CHARGE_THRESH_BATx): battery charge level below which charging will begin when connecting the charger.

  • Stop charge threshold (STOP_CHARGE_TRESH_BATx): battery charge level above which charging will stop while the charger is connected.

You cannot change the basic behavior described above, because it is hard-coded into the EC firmware by the vendor. However, you can control it by setting thresholds using TLP.

Charge thresholds written into the EC registers are persistently stored in the hardware of many vendors. Which means they are retained when another operating system is started - provided they are not changed by software installed there and the hardware actually supports persistence.

What charge thresholds do not do

  • They do not exercise any control over the discharging of the battery, this depends solely on whether AC is connected and if the laptop is switched on

  • In particular, with AC connected, a battery with a charge level higher than the stop charge threshold will not be discharged to the stop charge threshold, nor will there be a (cyclic) discharge down to the start charge threshold

See also

What is the purpose of battery charge thresholds?

See above.

How do battery charge thresholds work?

See above.

How to choose good battery charge thresholds?

Factory settings for ThinkPad battery thresholds are as follows: when plugged in the battery starts charging at 96%, and stops at 100%. These settings are optimized for maximum runtime, but having a battery hold a lot of power will decrease its capacity over the years. To alleviate this problem, the start/stop charge thresholds can be adjusted – at the cost of a more or less reduced battery runtime.

It all depends on how you use your laptop, or more precisely, on the minimal runtime you’re ready to accept when you’re on the road. In the end, it all comes down to a runtime vs. lifespan trade-off.

If the laptop is plugged most of the time and rarely unplugged, maximizing battery lifetime at the cost of a greatly reduced runtime may be acceptable, with values like starting charge at 40% and stopping at 50%.

On the contrary, if you use it unplugged most of the time, starting charge at 85% and stopping at 90% would allow for a much longer runtime and still give a lifespan benefit over the factory settings.

Default TLP settings (only if you uncomment the relevant lines) are slightly more protective regarding lifespan, with 75/80% charge thresholds.

Note

  • Please always consider that the start threshold is the critical constraint for runtime, because it defines the lowest charge level that can occur while plugged. Remember that TLP provides a command (tlp fullcharge) to fully charge the battery, when you need to temporarily maximize runtime (for example in case of a trip).

  • This section can be applied similarly to supported non-ThinkPad hardware as long as arbitrary threshold values (0..100) are supported. See the corresponding section in Battery Care Vendor Specifics.

Sources:

How to enable charge thresholds?

It is not enough to set charge thresholds once with the tlp setcharge command. To make charge thresholds permanent, even if the hardware does not have the ability to keep them persistent, you have to enter them into the configuration file, for example /etc/tlp.conf:

START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80

Then apply your changed configuration with the command

sudo tlp start

See also

How can I check if my configured charge thresholds are working?

The output of tlp-stat -b shows two characteristics for the positive case:

  1. An active battery care driver for the charge thresholds

  2. The actual charge threshold(s) – read back from the embedded controller

So if there is a line containing Supported features: charge threshold(s) and the displayed threshold(s) match(es) the one(s) you configured, then the charging logic has properly received them. The article Battery Care Vendor Specifics shows tlp-stat -b sample outputs for all supported hardware to compare. If your tlp-stat -b output does not contain the required characteristics, check the following sections for solutions.

However, if despite a correctly set up system the charge threshold(s) do(es) not work as you expect them to, then you should first compare your idea of the charging process with the description above and subsequently check the sections further down for possible explanations.

Note

On some models the displayed threshold values do not correspond to the configured ones, although they work as they should – refer to ThinkPad E / L / S / Yoga series.

Which external kernel module do I need for my ThinkPad?

Important

As of version 5.17, the Linux kernel in combination with TLP 1.5 or later offers full battery care support (i.e. charge thresholds and recalibration) for ThinkPads from model year 2011 onwards. The majority of current Linux distributions meet the kernel requirement.

An external kernel module (also referred to as an “out-of-tree” module) is not required in this case, and the following steps are not necessary. However, if your model is from 2011 or older, read on.

Prerequisite: make sure to install the most recent version of TLP for accurate recommendations.

Only if the bottom of the output of tlp-stat -b, section ‘Recommendations’, shows the line

Install tp-smapi kernel modules for ThinkPad battery thresholds and recalibration

then install the required package as explained in Installation for your distribution.

See also

Are ThinkPads with coreboot supported?

Version 1.5 and older

Some models are not recognized as ThinkPads because of an incorrect model string provided by coreboot. As a result battery care is not activated (see Issue #657). Sample output of tlp-stat:

+++ Battery Care
Plugin: generic
Supported features: none available
...
/sys/class/power_supply/BAT0/charge_control_start_threshold =      0 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold   =    100 [%]

When the recognition works, the capabilities are limited:

  • Charge thresholds: work.

  • Recalibration: not supported (see Issues #547, #626). Sample output of tlp-stat:

    /sys/class/power_supply/BAT1/charge_behaviour               = [auto]
    
  • Battery status: battery readings energy_full_design, energy_full and energy_now are missing from the tlp-stat -b output because coreboot supplies incorrect data to the Linux kernel (see Issue #657); sample output:

+++ Battery Care
Plugin: thinkpad
Supported features: charge thresholds, recalibration
Driver usage:
* natacpi (thinkpad_acpi) = active (charge thresholds, recalibration)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1:  0(off)..96(default)..99
* STOP_CHARGE_THRESH_BAT0/1:   1..100(default)

+++ ThinkPad Battery Status: BAT0 (Ultrabay / Slice / Replaceable)
/sys/class/power_supply/BAT1/manufacturer                   = SONY
/sys/class/power_supply/BAT1/model_name                     = 42T4967
/sys/class/power_supply/BAT1/cycle_count                    =      0 (or not supported)
/sys/class/power_supply/BAT1/status                         = Discharging
< battery readings missing here >

/sys/class/power_supply/BAT1/charge_control_start_threshold =     50 [%]
/sys/class/power_supply/BAT1/charge_control_end_threshold   =     60 [%]
/sys/class/power_supply/BAT1/charge_behaviour               = [auto]

Solutions:

  • Version 1.6(.1) properly recognizes ThinkPads with coreboot

  • Version 1.7 displays complete battery readings

Why is my battery charged up to 100% – ignoring the charge thresholds?

Possible causes are:

Laptop is not supported

Battery Care Vendor Specifics lists supported hardware and explains the prerequisites.

Kernel module thinkpad_acpi is not loaded

ThinkPads only

Symptoms:

+++ Battery Care
Plugin: generic
Supported features: none available

Trying to load it with sudo modprobe thinkpad_acpi will reveal

modprobe: ERROR: could not insert 'thinkpad_acpi': Invalid argument

Cause: your system configuration contains broken boot options for thinkpad_acpi.

Solution: check and correct your GRUB config (distribution dependent) or module config files (/etc/modprobe.d/*.conf).

External kernel module is not installed

Legacy ThinkPads only

Symptom: tlp-stat -b shows the line:

tp-smapi = inactive (kernel module 'tp_smapi' not installed)

Solution: follow Installation for your distribution and install the required package(s).

If tlp-stat -b still claims “not installed” after installing the appropriate package, reinstall the package via shell command and check the output for errors. See below for possible causes.

Installation of kernel module package failed

Legacy ThinkPads only

Important

tp-smapi derived packages are not provided by the TLP project. Please don’t file bug reports for them in the TLP issue tracker.

Symptom 1 (Ubuntu 23.10, 24.04 and later): see Ubuntu.

Symptom 2: tlp-stat -b displays

tpacpi-bat = inactive (kernel module 'acpi_call' not installed)

Solution:

Upgrade the kernel to 5.17 or later together with TLP version 1.5 for full natacpi support, rendering acpi_call obsolete.

Kernel module tp-smapi is not loaded

Legacy ThinkPads only

Symptom: tlp-stat -b displays the message

tp-smapi = inactive (kernel module 'tp_smapi' load error)

Solution: try to load manually with

sudo modprobe -v tp_smapi

Go through tp-smapi Troubleshooting for a solution that matches the error message displayed. If this is not successful, ask in relevant forums.

Note

Fedora release upgrade

Legacy ThinkPads only

It may be necessary to rebuild the kernel modules (as root):

akmods --force

ThinkPad E495

Symptom: thresholds have been written to the Embedded Controller (EC), tlp-stat -b reads them back as configured (see Issue #454):

/sys/class/power_supply/BAT0/charge_start_threshold = 45 [%]
/sys/class/power_supply/BAT0/charge_stop_threshold = 60 [%]

Yet they do not work.

Cause: bug in Lenovo’s EC firmware.

Workaround:

  • Update BIOS (contains EC firmware) to 1.16 or higher

  • Remove thresholds once from EC with tlp fullcharge

  • Leave the thresholds enabled in the config file

  • Reboot, which will restore the configured thresholds

ThinkPad T430(s)/T530/W530/X230 (and all later models)

Solution: install version 1.5 or later and a kernel ≥ 5.17 for full natacpi support.

ThinkPad T420(s)/T520/W520/X220

tp-smapi doesn’t support start threshold and recalibration on Sandy Bridge generation ThinkPads. Symptoms are:

tlp-stat -b shows

/sys/devices/platform/smapi/BAT0/start_charge_thresh = (not available)

tlp setcharge/tlp fullcharge show the message

start => Warning: cannot set threshold.

tlp discharge/recalibrate show the message

Error: battery discharge/recalibrate not available.

Solution: install version 1.5 or later and a kernel ≥ 5.17 for full natacpi support.

ThinkPad L420/520, L512, SL300/400/500, X121e

These models are neither supported by tp-smapi nor by tpacpi-bat or natacpi. Please refrain from opening issues.

ThinkPad charge thresholds not respected

Sometimes, a ThinkPad may ignore the charge thresholds even though the output of the tlp-stat -b shows that they were correctly written to the hardware:

/sys/class/power_supply/BAT1/charge_control_start_threshold =     75 [%]
/sys/class/power_supply/BAT1/charge_control_end_threshold   =     80 [%]

The cause may be a malfunction of the embedded controller (EC) e.g. a firmware bug or a “hiccup” of the firmware.

Solutions:

  • Reset the EC: shut down the system, then press the emergency reset hole (button) on the bottom of the ThinkPad with a paper clip. On older models, the EC is reset by shutting down, removing all batteries, disconnecting the power supply and pressing the power button for 30 seconds.

  • Update to the latest EC firmware (most elegantly with fwupdmgr).

If the measures described above do not help, the battery or system board may be defective.

ASUS laptops: stop charge threshold isn’t set at boot

Symptom: Battery stop charge threshold isn’t set at boot. But manually running tlp start or tlp setcharge sets the threshold.

Cause: kernel module asus_wmi is loaded too late in the boot sequence.

Solution: add the module to the Initramfs. The procedure depends on your distribution, for Arch Linux/Manjaro see Issue #602.

Mis-identification as ASUS laptop

Affected hardware: non-ASUS laptops

Symptom: tlp-stat -b shows

+++ Battery Care
Plugin: asus
Supported features: none available
Driver usage:
* natacpi (asus_wmi) = inactive (laptop not supported)

Workaround: unload and blacklist the asus_wmi kernel module.

Reference: Issue #739

LG laptop not supported

Symptom:

++ Battery Care
Plugin: lg
Supported features: none available
Driver usage:
* vendor (lg_laptop) = inactive (laptop not supported)

Cause: bug in kernel 6.9 and Ubuntu’s 6.8.

Solution: upgrade to kernel 6.10.7 or later.

Reference: Issue #747

MSI laptop not supported

Symptom:

+++ Battery Care
Plugin: generic
Supported features: none available

Cause: the msi_ec kernel driver only accepts very specific models and BIOS versions.

Solution: create an issue with the msi-ec driver.

Battery has been removed

By removing (and re-inserting) the battery the charge thresholds may be reset to vendor specific defaults. To restore TLP’s settings use

sudo tlp setcharge

(see Battery Care) or

  • Restart system

  • Shutdown and power off system

Charge thresholds shown by tlp-stat -b do not correspond to the configured ones

Possible causes are:

Configuration was not activated

After changes to the configuration it is necessary to reboot. Alternatively use

sudo tlp start

or

sudo tlp setcharge

to activate the thresholds.

ThinkPad E / L / S / Yoga series

Also affected: ThinkPad Edge series, 11, SL410/510

On these models the threshold values shown by tlp-stat -b do not correspond to the written values. For example the settings

START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80

may show up as

/sys/class/power_supply/BAT0/charge_start_threshold         =     75 [%]
/sys/class/power_supply/BAT0/charge_stop_threshold          =     74 [%]

or similar. Common feature is that one of the two threshold values is always displayed incorrectly.

The described behavior is caused by Lenovo’s EC firmware, not by TLP. Nonetheless the charge thresholds work as configured.

Start threshold does not apply after change

Affected hardware: ThinkPads X240, Yoga 12 (based on user feedback)

Workaround: activating a new start threshold may require to discharge the battery below the old start threshold after writing the new threshold, i.e. via tlp setcharge or reboot (see Issue #173).

Do charge thresholds work even when TLP is not running or the laptop is powered off?

Yes. The charging process is not controlled by software running on behalf of the operating system but by the embedded controller (EC). TLP only passes the threshold values to the EC firmware using the appropriate driver. Once stored in the EC, the thresholds also take effect when the laptop is switched off. See below for removal.

A general explanation of charge thresholds is given above.

What exactly does the start charge threshold START_CHARGE_THRESH_BATx do?

The start charge threshold ensures that the battery is not recharged immediately after every short discharge process. The charging process starts only when the previous discharge was below the value of START_CHARGE_THRESH_BATx.

A general explanation of charge thresholds is given above.

How to remove the charge thresholds?

As explained above, in many cases the charge thresholds are persistently stored in the hardware. Therefore, it is not sufficient to simply remove the thresholds from the configuration (by the way, disabling or uninstalling TLP is not enough either). In fact, two steps are required to disable the thresholds:

  1. Removing the charge thresholds from the configuration by inserting a leading #

#START_CHARGE_THRESH_BAT0=75
#STOP_CHARGE_THRESH_BAT0=80
  1. Reverting to vendor specific defaults with the command

sudo tlp fullcharge

Removing the charge thresholds does not work

Affected hardware: ThinkPad E580, T480s, X1 Carbon 6th Gen (and possibly others)

Symptom: after resetting the thresholds as described above, tlp-stat -b shows the stop threshold unchanged.

Cause: after applying a stop threshold value < 100, Lenovo’s EC firmware does not accept values higher than the previously set value.

Solution: update EC firmware (contained in BIOS update)

  • T480s: ECP 1.13 (BIOS 1.31) or higher

  • X1 Carbon 6th Gen: ECP 1.12 (BIOS 1.37) or higher

Workaround (without BIOS update):

  • Disable the threshold configuration as decribed above

  • Power off the laptop via shutdown

  • Unplug AC power

  • Power on the laptop

  • At the Lenovo logo: press Enter, F1 to enter the BIOS setup

  • Go to: Config → Power → Disable Built-in Battery, Enter, Y laptop will power off

  • Connect AC

  • Power on laptop

  • Check with tlp-stat -b – thresholds should be at factory settings 96/100% now

  • When unsuccessful, repeat the whole procedure

Various ThinkPad battery malfunctions

Affected hardware: ThinkPad T480, X280, X1 Carbon 4th Gen (and possibly others)

Note

TLP does not cause the symptoms described in this section.

At times, ThinkPads may exhibit symptoms that suggest a battery or hardware defect. Users have reported the following:

  • ThinkPad switches off as soon as the internal battery BAT0 is empty, even if the external battery BAT1 is still charged. Reference: Arch Linux forum.

  • ThinkPad unexpectedly switches off when the external battery BAT1 is removed, even if the internal battery BAT0 is still charged. Reference: Issue #690.

  • Battery is not charging even though the charger is connected and no charge threshold is active.

  • tlp recalibrate fails with “Error: discharge BATx malfunction – check your hardware (battery, charger)”.

However, in the mentioned cases, there was no battery or hardware defect, but rather a malfunction of the EC firmware, which controls all battery functions independently of the operating system.

Solutions:

  • Reset the EC: shut down the system, then press the emergency reset hole (button) on the bottom of the ThinkPad with a paper clip

  • Update to the latest EC firmware (most elegantly with fwupdmgr)

Erratic battery behavior on ThinkPad T420(s)/T520/W520/X220 (and possibly later models)

Symptom: some users report severely reduced battery capacity or sudden drops of the charge level from around 30% to zero when employing charge thresholds.

Probable cause: conflict with dualmode battery firmware (refer to How to choose good battery charge thresholds?).

Solution: remove battery thresholds completely or use only the start threshold by setting the stop threshold to 100%:

START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=100

Then recalibrate the battery once.

Note

This is a software only issue, no harm is done to the battery.

How to designate the battery to discharge when battery powered?

On dual battery ThinkPads, the embedded controller (EC) alone determines the order in which the batteries are used (discharged) and charged, as well as the switching point. The Lenovo EC firmware does not provide any way to change this behavior (except indirectly through charge thresholds and forced discharge, of course). Also, the behavior may vary from model to model.

The above means that selecting the active battery for ThinkPads - also called “battery balancing” - is impossible because the EC firmware provides no way to do this, either manually or automatically.

tlp fullcharge BAT1 stops at ~80%

Affected hardware: ThinkPad T440s (based on user feedback)

Symptom: although the stop threshold is set to 100% either by configuration or by tlp fullcharge/setcharge, the charge of BAT1 stops at about 80%. When BAT1 reaches 80%, BAT0 starts charging to 100%, then BAT1 continues to 100%. If a stop threshold is set for BAT0, the last step may never happen.

No solution: Lenovo’s EC firmware offers no possibility to change the behaviour (see above).

Why does the battery not begin to discharge when the stop threshold is reached?

Author’s note: sometimes users get into this misunderstanding without me understanding how it happens. This is an attempt to get them out.

The purpose of the stop threshold is to reduce battery wear by limiting the charge level below 100%. So charging stops at the threshold and the battery is not discharged as long as the charger remains connected. This is the manufacturer’s intended behavior. It cannot (and should not) be changed, because repeatedly discharging the battery while operating on AC power would lead to absurdly high wear (i.e. charging cycles) without any benefit.

A general explanation of charge thresholds is given above.

tlp recalibrate terminates with an error message

ThinkPads only

Impact: Recalibration will not work without a full discharge. This is to tell the battery controller (the one in the battery) where the actual 0% is.

Symptom 1:

Warning: battery BAT0 was not discharged completely -- AC/charger removed.

Solution: first make sure AC power is connected during the whole process then try a different charger.

Symptom 2:

Error: battery BAT0 was not discharged completely i.e. terminated by the firmware -- check your hardware (battery, charger).

Cause: this is a hardware issue either with your battery (likely), charger or laptop.

Solution: first try another battery pack then a different charger. If this does not remedy the situation, a system board defect could be the reason.

Note

  • If the discharge process regularly stops at 1%, for example, you may prefer to ignore the problem because it is minor (could be a rounding error). With higher values, however, it could be a battery or hardware defect.

  • Values ≤ 1% will not trigger an error message in version 1.7.

Why does the panel applet show the battery state “charging” despite charge thresholds are effective?

ThinkPads only

Existing panel applets query upowerd or the standard kernel interface which do not reflect the charging condition correctly as soon as charge thresholds intervene.

In this situation tlp-stat -b shows

  • “Idle” - Version 1.4 and later

  • “Unknown (threshold effective)” - Version 1.3

for /sys/class/power_supply/BATx/status.

For ThinkPad models supporting tp-smapi, the correct state “Idle” is shown for /sys/devices/platform/smapi/BATx/state.

Why does tlp-stat -b display “cycle_count = (not supported)”?

Cycle count is not available for all laptops. Positive exceptions are older ThinkPads supporting tp-smapi and certain newer hardware.

Note

For new batteries with zero cycles, tlp-stat -b displays (not supported) too. This is because the kernel output does not distinguish zero cycles from unsupported, it is 0 in both cases. With supported hardware the display works again as soon as the battery has at least one cycle.