linrunner / TLP

TLP - Optimize Linux Laptop Battery Life
https://linrunner.de/tlp
GNU General Public License v2.0
2.66k stars 128 forks source link

STOP_CHARGE_THRESH_BAT0 etc not Honored #752

Closed johnnya23 closed 1 month ago

johnnya23 commented 1 month ago

[x] I've read and accepted the Bug Reporting Howto [x] I've provided all required tlp-stat outputs via Gist (see below)

Describe the bug

Lap keeps charging beyond STOP_CHARGE_THRESH_BAT0 setting

Expected behavior

when the device reaches the threshold charging should stop and it should deplete the battery to the START_CHARGE_THRESH_BAT0 before "recharging"

To Reproduce

Steps to reproduce the unexpected behavior:

  1. Only relevant to AC
  2. set the STOP_CHARGE_THRESH_BAT0="80" in /etc/tlp.conf and plugin laptop and let charge to (and in my case beyond) 80%
  3. n/a
  4. *Full output of tlp-stat via https://gist.github.com/ for all* `sudo tlp-stat --- TLP 1.6.1 --------------------------------------------

+++ Configured Settings: defaults.conf L0006: TLP_ENABLE="1" defaults.conf L0007: TLP_WARN_LEVEL="3" /etc/tlp.conf L0056: TLP_PERSISTENT_DEFAULT="1" defaults.conf L0009: DISK_IDLE_SECS_ON_AC="0" defaults.conf L0010: DISK_IDLE_SECS_ON_BAT="2" defaults.conf L0011: MAX_LOST_WORK_SECS_ON_AC="15" defaults.conf L0012: MAX_LOST_WORK_SECS_ON_BAT="60" defaults.conf L0013: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance" defaults.conf L0014: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power" 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" defaults.conf L0022: SATA_LINKPWR_ON_BAT="med_power_with_dipm" 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: RESTORE_DEVICE_STATE_ON_STARTUP="0" /etc/tlp.conf L0549: RESTORE_THRESHOLDS_ON_BAT="0" defaults.conf L0052: NATACPI_ENABLE="1" defaults.conf L0053: TPACPI_ENABLE="1" defaults.conf L0054: TPSMAPI_ENABLE="1" /etc/tlp.conf L0533: START_CHARGE_THRESH_BAT0="75" /etc/tlp.conf L0535: STOP_CHARGE_THRESH_BAT0="80" /etc/tlp.conf L0542: START_CHARGE_THRESH_BAT1="75" /etc/tlp.conf L0544: STOP_CHARGE_THRESH_BAT1="80"

+++ System Info System = LENOVO IdeaPad Slim 5 16IRL8 82XF BIOS = LACN29WW EC Firmware = 1.29 OS Release = Linux Mint 21.3 Kernel = 6.5.0-44-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 x86_64 /proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-6.5.0-44-generic root=UUID=d5e205c5-033a-4eb9-affa-2b0c2a3d1992 ro quiet splash Init system = systemd v249 (249.11-0ubuntu3.12) Boot mode = UEFI Suspend mode = [s2idle] deep

+++ TLP Status State = enabled RDW state = not installed Last run = 01:35:30 PM, 937 sec(s) ago Mode = AC Power source = AC

+++ Processor CPU model = 13th Gen Intel(R) Core(TM) i7-1355U

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 400000 [kHz] /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 5000000 [kHz] /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq = 400000 [kHz] /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq = 5000000 [kHz] /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_performance [EPP] /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power

/sys/devices/system/cpu/cpu1..cpu11: omitted for clarity, use -v to show all

/sys/devices/system/cpu/intel_pstate/status = active /sys/devices/system/cpu/intel_pstate/min_perf_pct = 9 [%] /sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] /sys/devices/system/cpu/intel_pstate/no_turbo = 0 /sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost = 0 /sys/devices/system/cpu/intel_pstate/turbo_pct = (not available) /sys/devices/system/cpu/intel_pstate/num_pstates = (not available) /sys/module/workqueue/parameters/power_efficient = Y /proc/sys/kernel/nmi_watchdog = 0

+++ Platform Profile /sys/firmware/acpi/platform_profile = balanced /sys/firmware/acpi/platform_profile_choices = low-power balanced performance

+++ Temperatures CPU temp = 41 [°C] Fan speed = (not available)

+++ File System /proc/sys/vm/laptop_mode = 0 /proc/sys/vm/dirty_writeback_centisecs = 1500 /proc/sys/vm/dirty_expire_centisecs = 1500 /proc/sys/vm/dirty_ratio = 20 /proc/sys/vm/dirty_background_ratio = 10

+++ Disks Devices = nvme0n1 sda

/dev/nvme0n1: Type = NVMe Disk ID = nvme-WD_PC_SN740_SDDPMQD-512G-1101_23375U809562 Model = WD PC SN740 SDDPMQD-512G-1101
Firmware = 73116001 Temp = 34 °C Scheduler = [none] mq-deadline (multi queue)

Runtime PM: /sys/block/nvme0n1/device/power/control = on, autosuspend_delay_ms = (not available)

/dev/sda: not present.

+++ Intel Graphics /sys/class/drm/card0/device/driver = i915

/sys/class/drm/card0/power/rc6_enable = 1 (enabled) /sys/kernel/debug/dri/0/i915_fbc_status = FBC disabled: stride not supported /sys/module/i915/parameters/enable_psr = -1 (use per-chip default)

/sys/class/drm/card0/gt_min_freq_mhz = 100 [MHz] /sys/class/drm/card0/gt_max_freq_mhz = 1300 [MHz] /sys/class/drm/card0/gt_boost_freq_mhz = 1300 [MHz] /sys/class/drm/card0/gt_RPn_freq_mhz = 100 [MHz] (GPU min) /sys/class/drm/card0/gt_RP0_freq_mhz = 1300 [MHz] (GPU max)

+++ Wireless bluetooth = on nfc = none (no device) wifi = on wwan = none (no device)

hci0(btusb) : bluetooth, not connected wlp3s0(rtw89_8852be) : wifi, connected, power management = off

+++ Audio /sys/module/snd_hda_intel/parameters/power_save = 1 /sys/module/snd_hda_intel/parameters/power_save_controller = Y

+++ PCIe Active State Power Management /sys/module/pcie_aspm/parameters/policy = [default] performance powersave powersupersave

+++ PCIe Runtime Power Management Enable devices = (disabled) Disable devices = (disabled) Device denylist = (disabled) Driver denylist = mei_me nouveau radeon

/sys/bus/pci/devices/0000:00:00.0/power/control = on (0x060000, Host bridge, no driver) /sys/bus/pci/devices/0000:00:02.0/power/control = on (0x030000, VGA compatible controller, i915) /sys/bus/pci/devices/0000:00:04.0/power/control = on (0x118000, Signal processing controller, proc_thermal_pci) /sys/bus/pci/devices/0000:00:06.0/power/control = on (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:06.2/power/control = on (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:08.0/power/control = on (0x088000, System peripheral, no driver) /sys/bus/pci/devices/0000:00:0d.0/power/control = on (0x0c0330, USB controller, xhci_hcd) /sys/bus/pci/devices/0000:00:14.0/power/control = on (0x0c0330, USB controller, xhci_hcd) /sys/bus/pci/devices/0000:00:14.2/power/control = on (0x050000, RAM memory, no driver) /sys/bus/pci/devices/0000:00:15.0/power/control = on (0x0c8000, Serial bus controller, intel-lpss) /sys/bus/pci/devices/0000:00:15.3/power/control = on (0x0c8000, Serial bus controller, intel-lpss) /sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) /sys/bus/pci/devices/0000:00:19.0/power/control = on (0x0c8000, Serial bus controller, intel-lpss) /sys/bus/pci/devices/0000:00:19.1/power/control = on (0x0c8000, Serial bus controller, intel-lpss) /sys/bus/pci/devices/0000:00:1c.0/power/control = on (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:1d.0/power/control = on (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:1f.0/power/control = on (0x060100, ISA bridge, no driver) /sys/bus/pci/devices/0000:00:1f.3/power/control = on (0x040380, Audio device, snd_hda_intel) /sys/bus/pci/devices/0000:00:1f.4/power/control = on (0x0c0500, SMBus, i801_smbus) /sys/bus/pci/devices/0000:00:1f.5/power/control = on (0x0c8000, Serial bus controller, intel-spi) /sys/bus/pci/devices/0000:02:00.0/power/control = on (0x010802, Non-Volatile memory controller, nvme) /sys/bus/pci/devices/0000:03:00.0/power/control = on (0x028000, Network controller, rtw89_8852be) /sys/bus/pci/devices/0000:04:00.0/power/control = on (0x080501, SD Host controller, sdhci-pci)

+++ USB Autosuspend = enabled Device allowlist = (not configured) Device denylist = (not configured) Exclude audio = enabled Exclude bluetooth = disabled Exclude phones = disabled Exclude printers = enabled Exclude WWAN = disabled

Bus 004 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) Bus 003 Device 006 ID 27c6:55b4 control = auto, autosuspend_delay_ms = 2000 -- Shenzhen Goodix Technology Co.,Ltd. Fingerprint Reader (no driver) Bus 003 Device 005 ID 5986:215f control = auto, autosuspend_delay_ms = 2000 -- Acer, Inc Integrated Camera (uvcvideo) Bus 003 Device 004 ID 046d:c542 control = on, autosuspend_delay_ms = 2000 -- Logitech, Inc. Wireless Receiver (usbhid) Bus 003 Device 003 ID 343c:0000 control = auto, autosuspend_delay_ms = 2000 -- xxxxxxxx USB Type-C Digital AV Adapter (no driver) Bus 003 Device 007 ID 0bda:4853 control = auto, autosuspend_delay_ms = 2000 -- Realtek Semiconductor Corp. Bluetooth Radio (btusb) Bus 003 Device 002 ID 046d:c52e control = on, autosuspend_delay_ms = 2000 -- Logitech, Inc. MK260 Wireless Combo Receiver (usbhid) Bus 003 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub)

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

/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode = 0 (100%)

+++ Battery Status: BAT1 /sys/class/power_supply/BAT1/manufacturer = LGES /sys/class/power_supply/BAT1/model_name = L22L3PA4 /sys/class/power_supply/BAT1/cycle_count = 0 (or not supported) /sys/class/power_supply/BAT1/energy_full_design = 56600 [mWh] /sys/class/power_supply/BAT1/energy_full = 56600 [mWh] /sys/class/power_supply/BAT1/energy_now = 47700 [mWh] /sys/class/power_supply/BAT1/power_now = 33534 [mW] /sys/class/power_supply/BAT1/status = Charging

Charge = 84.3 [%] Capacity = 100.0 [%]

+++ Recommendations

Additional context

This is a lenovo Slimpad, so I don't think the Thinkpad issues apply? THANKS

linrunner commented 1 month ago

Hi, with non-thinkpad Lenovos, you cannot freely select the threshold value, as the hardware only supports a fixed threshold.

The documentation explains how to configure: https://linrunner.de/tlp/settings/bc-vendors.html#lenovo-non-thinkpad-series

Crossref: https://forums.linuxmint.com/viewtopic.php?t=425415

Good luck.

johnnya23 commented 1 month ago

ok, it seems the start threshold vaule is irrelevant (I tried 0 and 70). Setting stop threshold to "1" causes my LENOVO IdeaPad Slim 5 16IRL8 82XF to hold at a charge of 79%. I guess that will do. thanks.