Skip to content

Instantly share code, notes, and snippets.

@linrunner
Last active February 28, 2024 17:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linrunner/fee8feeb079efc03001d9f3671146298 to your computer and use it in GitHub Desktop.
Save linrunner/fee8feeb079efc03001d9f3671146298 to your computer and use it in GitHub Desktop.

TLP 1.4 Test: Battery Care for LG Gram Laptops

Read the overview document first.

Supported Features

LG Gram laptops using the lg_laptop driver have a feature called 'battery care limit', basically a fixed stop charge threshold at 80%. The hardware behaviour is:

  1. Connected to the charger, charging stops when the charge level reaches the stop threshold

  2. If the charge level is higher than the stop threshold, the battery will not discharge automatically; it will only be discharged when the charger is removed i.e. the laptop runs on battery

When suitable hardware has been detected, tlp-stat -b shows:

++ Battery Care
Plugin: lg
Supported features: charge threshold
Driver usage:
* vendor (lg_laptop) = active (charge threshold)
Parameter value range:
* STOP_CHARGE_THRESH_BAT0: 80(on), 100(off) -- battery care limit

/sys/devices/platform/lg-laptop/battery_care_limit          = 80 [%]

How it works

Battery charging is a process not controlled by TLP itself, but by the laptop's embedded controller (EC). This makes the process work even when switched off or no operating system is running. You cannot change the basic behavior, it is hard-coded into the EC firmware by the vendor. TLP just writes the charge threshold into the EC with the help of the kernel driver, the EC takes care of the rest.

Installation

Packages are provided at the download page.

Linux kernel 4.20 or higher required.

Test Cases

Important: please provide all terminal input and output from the test cases via an individual Gist and link it in your post below.

1. Configure and enable battery care limit

Edit /etc/tlp.conf (or a config file of your choice under /etc/tlp.d/):

STOP_CHARGE_THRESH_BAT0="80"

Connect the charger.

Enter the following commands in a terminal (as root or with sudo):

tlp start
tlp-stat -s -c -b

Verify that battery_care_limit = 80.

2. Verify the charging process

  1. Let the laptop run on battery power until the charge level falls below at least 70%
  2. Connect the charger and see if charging starts
  3. Verify that charging stops at 80%

Enter the command (as root or with sudo):

tlp-stat -b

3. Disable battery care limit and return to full charge

Edit the config file used above:

STOP_CHARGE_THRESH_BAT0="100"

Enter the commands (as root or with sudo):

tlp fullcharge
tlp-stat -b

Verify that battery_care_limit = 100 and the battery gets fully charged.

What else should I check?

  • Are there LG Gram laptops with more than one battery (tlp-stat -b should show)?
@Sparsa
Copy link

Sparsa commented May 24, 2021

+++ Battery Wear Control
Plugin: lg
Supported features: charge threshold
Driver usage:
* vendor (lg_laptop) = active (charge threshold)
Parameter value range:
* STOP_CHARGE_THRESH_BAT0: 80(on), 100(off) -- battery care limit

/sys/devices/platform/lg-laptop/battery_care_limit          = 80 [%]

Output of tlp-stat -b on lg-gram laptop.
It works fine i.e., stops charging at 80%

when I execute the command
tlp fullcharge
it resets the value of the limit file to 100 and charges till 100 percent, interesting is this command throws an error when it is not connected to the power source. This is cool ;D

sudo tlp fullcharge
Setting temporary charge threshold for all batteries:
  care limit = 100
Charging starts now, keep AC connected.

@linrunner
Copy link
Author

Thanks for testing.

The AC check in tlp fullcharge was introduced many years ago for ThinkPads. You may bypass it in battery mode with this equivalent command:

tlp setcharge 0 100

or of course by changing the configuration accordingly and issue

tlp start

@Sparsa
Copy link

Sparsa commented May 25, 2021

So anything else to be done from my end? This seems to be working seamlessly with my current setup :D, thanks for considering it.

@linrunner
Copy link
Author

Not at the moment. I'll let you know when the beta release is ready.

@PPVJM
Copy link

PPVJM commented Aug 10, 2021

Folks, regardless of what I do I can't get battery_care_limit=80

Here's what tlp-stat -s -c -b gives me:

ricardo@LG:~$ sudo tlp-stat -s -c -b
--- TLP 1.4.0-beta.1 --------------------------------------------

+++ Configured Settings:
/etc/tlp.conf L0029: TLP_ENABLE="1"
defaults.conf L0005: TLP_WARN_LEVEL="3"
defaults.conf L0006: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0008: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0010: MAX_LOST_WORK_SECS_ON_BAT="60"
defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance"
defaults.conf L0012: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power"
defaults.conf L0013: SCHED_POWERSAVE_ON_AC="0"
defaults.conf L0014: SCHED_POWERSAVE_ON_BAT="1"
defaults.conf L0015: NMI_WATCHDOG="0"
defaults.conf L0016: DISK_DEVICES="nvme0n1 sda"
defaults.conf L0017: DISK_APM_LEVEL_ON_AC="254 254"
defaults.conf L0018: DISK_APM_LEVEL_ON_BAT="128 128"
defaults.conf L0019: DISK_APM_CLASS_DENYLIST="usb ieee1394"
defaults.conf L0020: DISK_IOSCHED="keep keep"
defaults.conf L0021: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
defaults.conf L0022: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
defaults.conf L0023: AHCI_RUNTIME_PM_ON_AC="on"
defaults.conf L0024: AHCI_RUNTIME_PM_ON_BAT="auto"
defaults.conf L0025: AHCI_RUNTIME_PM_TIMEOUT="15"
defaults.conf L0026: PCIE_ASPM_ON_AC="default"
defaults.conf L0027: PCIE_ASPM_ON_BAT="default"
defaults.conf L0028: RADEON_POWER_PROFILE_ON_AC="default"
defaults.conf L0029: RADEON_POWER_PROFILE_ON_BAT="default"
defaults.conf L0030: RADEON_DPM_PERF_LEVEL_ON_AC="auto"
defaults.conf L0031: RADEON_DPM_PERF_LEVEL_ON_BAT="auto"
defaults.conf L0032: WIFI_PWR_ON_AC="off"
defaults.conf L0033: WIFI_PWR_ON_BAT="on"
defaults.conf L0034: WOL_DISABLE="Y"
defaults.conf L0035: SOUND_POWER_SAVE_ON_AC="1"
defaults.conf L0036: SOUND_POWER_SAVE_ON_BAT="1"
defaults.conf L0037: SOUND_POWER_SAVE_CONTROLLER="Y"
defaults.conf L0038: BAY_POWEROFF_ON_AC="0"
defaults.conf L0039: BAY_POWEROFF_ON_BAT="0"
defaults.conf L0040: BAY_DEVICE="sr0"
defaults.conf L0041: RUNTIME_PM_ON_AC="on"
defaults.conf L0042: RUNTIME_PM_ON_BAT="auto"
defaults.conf L0043: RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau radeon"
defaults.conf L0044: USB_AUTOSUSPEND="1"
defaults.conf L0045: USB_EXCLUDE_AUDIO="1"
defaults.conf L0046: USB_EXCLUDE_BTUSB="0"
defaults.conf L0047: USB_EXCLUDE_PHONE="0"
defaults.conf L0048: USB_EXCLUDE_PRINTER="1"
defaults.conf L0049: USB_EXCLUDE_WWAN="0"
defaults.conf L0050: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0"
defaults.conf L0051: RESTORE_DEVICE_STATE_ON_STARTUP="0"
defaults.conf L0052: RESTORE_THRESHOLDS_ON_BAT="0"
defaults.conf L0053: NATACPI_ENABLE="1"
defaults.conf L0054: TPACPI_ENABLE="1"
defaults.conf L0055: TPSMAPI_ENABLE="1"
/etc/tlp.conf L0500: STOP_CHARGE_THRESH_BAT0="80"

+++ System Info
System = LG Electronics 0.1 17Z990-R.AAS7U1
BIOS = W1ZD1250 X64
OS Release = Ubuntu 18.04.5 LTS
Kernel = 5.4.0-80-generic #90~18.04.1-Ubuntu SMP Tue Jul 13 19:40:02 UTC 2021 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-5.4.0-80-generic root=UUID=dc0a74e6-8f43-412b-bf1c-43a26ab5c36b ro quiet splash vt.handoff=1
Init system = systemd v237
Boot mode = UEFI

+++ TLP Status
State = enabled
RDW state = enabled
Last run = 10:59:35, 85 sec(s) ago
Mode = battery
Power source = battery

+++ Battery Care
Plugin: lg
Supported features: charge threshold
Driver usage:

  • vendor (lg_laptop) = active (charge threshold)
    Parameter value range:
  • STOP_CHARGE_THRESH_BAT0: 80(on), 100(off) -- battery care limit

/sys/devices/platform/lg-laptop/battery_care_limit = 0 [%]

What am I doing wrong? Please notice that I'm using Ubuntu Mate (Linux LG 5.4.0-80-generic #90~18.04.1-Ubuntu SMP Tue Jul 13 19:40:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux).

@linrunner
Copy link
Author

@PPVJM : you ain't doing anything wrong. You just have the bad luck that your model does not support the feature. The next beta (or the release) will properly detect this. See linrunner/TLP#568

@linrunner
Copy link
Author

Beta 2 is out. Enjoy!

@atkiss
Copy link

atkiss commented Sep 10, 2021

Thank you for your hard work and sorry for the bad news. Previously I had exactly the same issue what @PPVJM had but now it looks even worse based on the logs.
It's a 2021 lg gram:

neon@neon:~$ sudo tlp start
Error: could not read current care limit. Skipped.
TLP started in AC mode (auto).
neon@neon:~$ sudo tlp-stat -s -c -b
--- TLP 1.4.0-beta.2 --------------------------------------------

+++ Configured Settings:
defaults.conf L0004: TLP_ENABLE="1"
defaults.conf L0005: TLP_WARN_LEVEL="3"
defaults.conf L0006: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0008: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0010: MAX_LOST_WORK_SECS_ON_BAT="60"
defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance"
defaults.conf L0012: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power"
defaults.conf L0013: SCHED_POWERSAVE_ON_AC="0"
defaults.conf L0014: SCHED_POWERSAVE_ON_BAT="1"
defaults.conf L0015: NMI_WATCHDOG="0"
defaults.conf L0016: DISK_DEVICES="nvme0n1 sda"
defaults.conf L0017: DISK_APM_LEVEL_ON_AC="254 254"
defaults.conf L0018: DISK_APM_LEVEL_ON_BAT="128 128"
defaults.conf L0019: DISK_APM_CLASS_DENYLIST="usb ieee1394"
defaults.conf L0020: DISK_IOSCHED="keep keep"
defaults.conf L0021: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
defaults.conf L0022: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
defaults.conf L0023: AHCI_RUNTIME_PM_ON_AC="on"
defaults.conf L0024: AHCI_RUNTIME_PM_ON_BAT="auto"
defaults.conf L0025: AHCI_RUNTIME_PM_TIMEOUT="15"
defaults.conf L0026: PCIE_ASPM_ON_AC="default"
defaults.conf L0027: PCIE_ASPM_ON_BAT="default"
defaults.conf L0028: RADEON_DPM_PERF_LEVEL_ON_AC="auto"
defaults.conf L0029: RADEON_DPM_PERF_LEVEL_ON_BAT="auto"
defaults.conf L0030: RADEON_POWER_PROFILE_ON_AC="default"
defaults.conf L0031: RADEON_POWER_PROFILE_ON_BAT="default"
defaults.conf L0032: WIFI_PWR_ON_AC="off"
defaults.conf L0033: WIFI_PWR_ON_BAT="on"
defaults.conf L0034: WOL_DISABLE="Y"
defaults.conf L0035: SOUND_POWER_SAVE_ON_AC="1"
defaults.conf L0036: SOUND_POWER_SAVE_ON_BAT="1"
defaults.conf L0037: SOUND_POWER_SAVE_CONTROLLER="Y"
defaults.conf L0038: BAY_POWEROFF_ON_AC="0"
defaults.conf L0039: BAY_POWEROFF_ON_BAT="0"
defaults.conf L0040: BAY_DEVICE="sr0"
defaults.conf L0041: RUNTIME_PM_ON_AC="on"
defaults.conf L0042: RUNTIME_PM_ON_BAT="auto"
defaults.conf L0043: RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau radeon"
defaults.conf L0044: USB_AUTOSUSPEND="1"
defaults.conf L0045: USB_EXCLUDE_AUDIO="1"
defaults.conf L0046: USB_EXCLUDE_BTUSB="0"
defaults.conf L0047: USB_EXCLUDE_PHONE="0"
defaults.conf L0048: USB_EXCLUDE_PRINTER="1"
defaults.conf L0049: USB_EXCLUDE_WWAN="0"
defaults.conf L0050: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0"
defaults.conf L0051: RESTORE_DEVICE_STATE_ON_STARTUP="0"
defaults.conf L0052: RESTORE_THRESHOLDS_ON_BAT="0"
defaults.conf L0053: NATACPI_ENABLE="1"
defaults.conf L0054: TPACPI_ENABLE="1"
defaults.conf L0055: TPSMAPI_ENABLE="1"
/etc/tlp.conf L0502: STOP_CHARGE_THRESH_BAT0="80"

+++ System Info
System         = LG Electronics 0.1 17Z90P-K.AA75A1
BIOS           = T2ZF0320 X64
OS Release     = KDE neon User Edition 5.22
Kernel         = 5.11.0-25-generic #27~20.04.1-Ubuntu SMP Tue Jul 13 17:41:23 UTC 2021 x86_64
/proc/cmdline  = BOOT_IMAGE=/casper/vmlinuz boot=casper apparmor=0 quiet splash ---
Init system    = systemd v245 (245.4-4ubuntu3.11)
Boot mode      = UEFI

+++ TLP Status
State          = enabled
RDW state      = enabled
Last run       = 20:39:34,     28 sec(s) ago
Mode           = AC
Power source   = AC

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

+++ Battery Status: CMB0
/sys/class/power_supply/CMB0/manufacturer                   =  LG  
/sys/class/power_supply/CMB0/model_name                     = LGC-LGC
/sys/class/power_supply/CMB0/cycle_count                    =     18
/sys/class/power_supply/CMB0/energy_full_design             =  80000 [mWh]
/sys/class/power_supply/CMB0/energy_full                    =  75670 [mWh]
/sys/class/power_supply/CMB0/energy_now                     =  26710 [mWh]
/sys/class/power_supply/CMB0/power_now                      = (not available)  
/sys/class/power_supply/CMB0/status                         = Charging

Charge                                                      =   35.3 [%]
Capacity                                                    =   94.6 [%]

@linrunner
Copy link
Author

linrunner commented Sep 11, 2021

@atkiss : Your "bad news" are welcome 👍. That's the purpose of the beta test. In fact, the message from tlp start should be

Error: battery charge thresholds not available.

Please enable trace mode by adding

TLP_DEBUG="bat ps run"

to your config file. Then enter the commands

sudo tlp noop
sudo tlp-stat -T 

and show the trace output. I also need the output of

ls -l /sys/devices/platform/lg-laptop/
ls -l /sys/class/power_supply/CMB0/

@atkiss
Copy link

atkiss commented Sep 11, 2021

Hope this helps. If you need any additional info pls let me know.

root@neon:~# tlp noop
Debug: no operation performed.
root@neon:~# tlp-stat -T
--- TLP 1.4.0-beta.2 --------------------------------------------

-- Logs begin at Sat 2021-09-11 19:57:36 UTC, end at Sat 2021-09-11 20:57:32 UTC. --
Sep 11 20:05:46 neon tlp[3731]: +++ noop (1.4.0-beta.2) ++++++++++++++++++++++++++++++++++++++++
Sep 11 20:05:46 neon tlp[3731]: get_sys_power_supply(ADP1).ac_online: syspwr=0
Sep 11 20:05:46 neon tlp[3731]: power_source=ac
Sep 11 20:05:46 neon tlp[3731]: manual_mode=none
Sep 11 20:05:46 neon tlp[3731]: power_mode=ac
Sep 11 20:05:46 neon tlp[3731]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.thinkpad.not_a_thinkpad
Sep 11 20:05:46 neon tlp[3731]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.thinkpad-legacy.not_a_thinkpad
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.asus.no_match
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.huawei.no_match
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.lenovo.no_match
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.samsung.no_match
Sep 11 20:05:46 neon tlp[3731]: batdrv_init.lg: batteries=CMB0; natacpi=254; thresh=none; bf_stop=
Sep 11 20:05:46 neon tlp[3731]: batdrv.lg.select_battery(DEF): bat_str=CMB0; bd_read=/sys/class/power_supply/CMB0;
Sep 11 20:05:46 neon tlp[3731]: save_runconf.ok: /run/tlp/tlp-run.conf_tmpR8u5K8 -> /run/tlp/run.conf
root@neon:~# ls -l /sys/devices/platform/lg-laptop/
total 0
-rw-r--r-- 1 root root 4096 Sep 11 20:02 battery_care_limit
lrwxrwxrwx 1 root root    0 Sep 11  2021 driver -> ../../../bus/platform/drivers/lg-laptop
-rw-r--r-- 1 root root 4096 Sep 11 20:08 driver_override
-rw-r--r-- 1 root root 4096 Sep 11 20:08 fan_mode
-rw-r--r-- 1 root root 4096 Sep 11 20:08 fn_lock
drwxr-xr-x 4 root root    0 Sep 11  2021 leds
-r--r--r-- 1 root root 4096 Sep 11 20:08 modalias
drwxr-xr-x 2 root root    0 Sep 11 20:08 power
-rw-r--r-- 1 root root 4096 Sep 11 20:08 reader_mode
lrwxrwxrwx 1 root root    0 Sep 11  2021 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 4096 Sep 11  2021 uevent
-rw-r--r-- 1 root root 4096 Sep 11 20:08 usb_charge
root@neon:~# ls -l /sys/class/power_supply/CMB0/
total 0
-rw-r--r-- 1 root root 4096 Sep 11 20:08 alarm
-r--r--r-- 1 root root 4096 Sep 11  2021 capacity
-r--r--r-- 1 root root 4096 Sep 11 20:08 capacity_level
-r--r--r-- 1 root root 4096 Sep 11 20:02 cycle_count
lrwxrwxrwx 1 root root    0 Sep 11 20:08 device -> ../../../PNP0C0A:00
-r--r--r-- 1 root root 4096 Sep 11  2021 energy_full
-r--r--r-- 1 root root 4096 Sep 11  2021 energy_full_design
-r--r--r-- 1 root root 4096 Sep 11  2021 energy_now
drwxr-xr-x 3 root root    0 Sep 11  2021 hwmon2
-r--r--r-- 1 root root 4096 Sep 11  2021 manufacturer
-r--r--r-- 1 root root 4096 Sep 11  2021 model_name
drwxr-xr-x 2 root root    0 Sep 11 20:08 power
-r--r--r-- 1 root root 4096 Sep 11  2021 power_now
-r--r--r-- 1 root root 4096 Sep 11  2021 present
-r--r--r-- 1 root root 4096 Sep 11  2021 serial_number
-r--r--r-- 1 root root 4096 Sep 11  2021 status
lrwxrwxrwx 1 root root    0 Sep 11  2021 subsystem -> ../../../../../../../../../class/power_supply
-r--r--r-- 1 root root 4096 Sep 11  2021 technology
-r--r--r-- 1 root root 4096 Sep 11  2021 type
-rw-r--r-- 1 root root 4096 Sep 11  2021 uevent
-r--r--r-- 1 root root 4096 Sep 11  2021 voltage_min_design
-r--r--r-- 1 root root 4096 Sep 11  2021 voltage_now

@linrunner
Copy link
Author

@atkiss : looks normal so far. Now lets check your use case:

sudo tlp start
sudo tlp-stat -T 

@atkiss
Copy link

atkiss commented Sep 13, 2021

@linrunner here we go:

root@neon:~# sudo tlp start
Error: could not read current care limit. Skipped.
TLP started in AC mode (auto).
root@neon:~# sudo tlp-stat -T
--- TLP 1.4.0-beta.2 --------------------------------------------

-- Logs begin at Sun 2021-09-12 20:53:45 UTC, end at Sun 2021-09-12 21:53:46 UTC. --
Sep 12 20:59:06 neon tlp[4151]: +++ noop (1.4.0-beta.2) ++++++++++++++++++++++++++++++++++++++++
Sep 12 20:59:06 neon tlp[4151]: get_sys_power_supply(ADP1).ac_online: syspwr=0
Sep 12 20:59:06 neon tlp[4151]: power_source=ac
Sep 12 20:59:06 neon tlp[4151]: manual_mode=none
Sep 12 20:59:06 neon tlp[4151]: power_mode=ac
Sep 12 20:59:06 neon tlp[4151]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.thinkpad.not_a_thinkpad
Sep 12 20:59:06 neon tlp[4151]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.thinkpad-legacy.not_a_thinkpad
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.asus.no_match
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.huawei.no_match
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.lenovo.no_match
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.samsung.no_match
Sep 12 20:59:06 neon tlp[4151]: batdrv_init.lg: batteries=CMB0; natacpi=254; thresh=none; bf_stop=
Sep 12 20:59:06 neon tlp[4151]: batdrv.lg.select_battery(DEF): bat_str=CMB0; bd_read=/sys/class/power_supply/CMB0;
Sep 12 20:59:06 neon tlp[4151]: save_runconf.ok: /run/tlp/tlp-run.conf_tmpa2ZLIE -> /run/tlp/run.conf
Sep 12 21:00:01 neon tlp[4230]: +++ start (1.4.0-beta.2) ++++++++++++++++++++++++++++++++++++++++
Sep 12 21:00:01 neon tlp[4230]: get_sys_power_supply(ADP1).ac_online: syspwr=0
Sep 12 21:00:01 neon tlp[4230]: power_source=ac
Sep 12 21:00:01 neon tlp[4230]: manual_mode=none
Sep 12 21:00:01 neon tlp[4230]: power_mode=ac
Sep 12 21:00:01 neon tlp[4230]: compare_and_save_power_state(0).different: old=
Sep 12 21:00:02 neon tlp[4230]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.thinkpad.not_a_thinkpad
Sep 12 21:00:02 neon tlp[4230]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.thinkpad-legacy.not_a_thinkpad
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.asus.no_match
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.huawei.no_match
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.lenovo.no_match
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.samsung.no_match
Sep 12 21:00:02 neon tlp[4230]: batdrv_init.lg: batteries=CMB0; natacpi=254; thresh=none; bf_stop=
Sep 12 21:00:02 neon tlp[4230]: batdrv.lg.read_threshold: bf_stop=; out=; rc=255
Sep 12 21:00:02 neon tlp[4230]: batdrv.lg.write_thresholds(80, 1, BAT0).read_error
Sep 12 21:00:02 neon tlp[4230]: save_runconf.ok: /run/tlp/tlp-run.conf_tmp9JPVnq -> /run/tlp/run.conf
root@neon:~# 

@linrunner
Copy link
Author

@atkiss : the problem is not only related to the LG plugin. Thanks for reporting.

Now fixed: linrunner/TLP@c2646f6

Package download:

Please test again:

sudo tlp start
sudo tlp-stat -T 

@atkiss
Copy link

atkiss commented Sep 14, 2021

@linrunner This is the result of the commands with the new version:

root@neon:~# tlp start
TLP started in battery mode (auto).
root@neon:~# tlp-stat -T
--- TLP 1.4.0-beta.2 --------------------------------------------

-- Logs begin at Mon 2021-09-13 22:43:45 UTC, end at Mon 2021-09-13 23:43:45 UTC. --
Sep 13 22:48:27 neon tlp[3578]: +++ start (1.4.0-beta.2) ++++++++++++++++++++++++++++++++++++++++
Sep 13 22:48:27 neon tlp[3578]: get_sys_power_supply(ADP1).ac_offline: syspwr=1
Sep 13 22:48:27 neon tlp[3578]: power_source=bat
Sep 13 22:48:27 neon tlp[3578]: manual_mode=none
Sep 13 22:48:27 neon tlp[3578]: power_mode=bat
Sep 13 22:48:27 neon tlp[3578]: compare_and_save_power_state(1).different: old=
Sep 13 22:48:27 neon tlp[3578]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.thinkpad.not_a_thinkpad
Sep 13 22:48:27 neon tlp[3578]: check_thinkpad.not_a_thinkpad: model=0.1
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.thinkpad-legacy.not_a_thinkpad
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.asus.no_match
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.huawei.no_match
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.lenovo.no_match
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.samsung.no_match
Sep 13 22:48:27 neon tlp[3578]: batdrv_init.lg: batteries=CMB0; natacpi=254; thresh=none; bf_stop=
Sep 13 22:48:27 neon tlp[3578]: set_charge_thresholds.no_method
Sep 13 22:48:27 neon tlp[3578]: save_runconf.ok: /run/tlp/tlp-run.conf_tmpgeWCoU -> /run/tlp/run.conf

root@neon:~# tlp-stat -b
--- TLP 1.4.0-beta.2 --------------------------------------------

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

+++ Battery Status: CMB0
/sys/class/power_supply/CMB0/manufacturer                   =  LG  
/sys/class/power_supply/CMB0/model_name                     = LGC-LGC
/sys/class/power_supply/CMB0/cycle_count                    =     18
/sys/class/power_supply/CMB0/energy_full_design             =  80000 [mWh]
/sys/class/power_supply/CMB0/energy_full                    =  75750 [mWh]
/sys/class/power_supply/CMB0/energy_now                     =  49000 [mWh]
/sys/class/power_supply/CMB0/power_now                      =   8537 [mW]
/sys/class/power_supply/CMB0/status                         = Discharging

Charge                                                      =   64.7 [%]
Capacity                                                    =   94.7 [%]

@linrunner
Copy link
Author

@atkiss : results are as expected now 👍

@atkiss
Copy link

atkiss commented Sep 16, 2021

Sorry @linrunner I'm confused now. So does this mean that the battery care is not supported on my laptop?

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

@linrunner
Copy link
Author

linrunner commented Sep 17, 2021

Exactly. The kernel driver must be adapted, please join the discussion here: linrunner/TLP#568 (comment)

@atkiss
Copy link

atkiss commented Sep 17, 2021

Exactly. The kernel driver must be adapted, please join the discussion here: linrunner/TLP#568 (comment)

Ah I see, thanks for all your effort anyway!

@linrunner
Copy link
Author

TLP 1.4 is released. Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment