linrunner / TLP

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

Not discharging after reaching upper threshold #664

Closed yarinbar closed 1 year ago

yarinbar commented 1 year ago

Battery is fixed on the upper threshold ("STOP_CHARGE_THRESH_BAT0") and does not discharge down to "START_CHARGE_THRESH_BAT0".

In this image we can see that it is not charging but somehow it keeps the battery at the same level, might be charging in short intervals once in a few seconds to keep it steady at this level.

But i think the expected behaviour is discharging down to the START_CHARGE_THRESH_BAT0. If i pulg it in when the battery is between the two thresholds it charges it up to STOP_CHARGE_THRESH_BAT0.

image

sudo tlp discharge 
Error: battery discharge/recalibrate not available.

sudo tlp-stat

--- TLP 1.5.0 --------------------------------------------

+++ 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_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 L0501: START_CHARGE_THRESH_BAT0="50"
/etc/tlp.conf L0502: STOP_CHARGE_THRESH_BAT0="80"

+++ System Info
System         = ASUSTeK COMPUTER INC. 1.0 ZenBook UX425EA_UX425EA
BIOS           = UX425EA.308
OS Release     = Fedora Linux 36 (KDE Plasma)
Kernel         = 6.0.10-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Nov 26 16:53:11 UTC 2022 x86_64
/proc/cmdline  = BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.0.10-200.fc36.x86_64 root=UUID=82376cda-8292-4526-b5d4-209328eb3309 ro rootflags=subvol=@ rhgb quiet
Init system    = systemd
Boot mode      = UEFI
SELinux status = enabled (enforcing)

+++ TLP Status
State          = enabled
RDW state      = not installed
Last run       = 10:13:59 AM,   7324 sec(s) ago
Mode           = AC
Power source   = AC

+++ Processor
CPU model      = 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

/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  =  4700000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_performance [HWP.EPP]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power

/sys/devices/system/cpu/cpu1..cpu7: 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      =   8 [%]
/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         =  44 [%]
/sys/devices/system/cpu/intel_pstate/num_pstates       =  44

/sys/module/workqueue/parameters/power_efficient       = N
/proc/sys/kernel/nmi_watchdog                          = 0

+++ Platform Profile
/sys/firmware/acpi/platform_profile                    = (not available)
/sys/firmware/acpi/platform_profile_choices            = (not available)

+++ Temperatures
CPU temp               =    54 [°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-Samsung_SSD_970_EVO_Plus_1TB_S6S1NS0T318615Z
Model      = Samsung SSD 970 EVO Plus 1TB
Firmware   = 4B2QEXM7
Temp       = 47 °C
Scheduler  = [none] mq-deadline kyber bfq (multi queue)

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

SMART info:
Critical Warning:                   0x00
Temperature:                        47 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Written:                 12,299,522 [6.29 TB]
Power Cycles:                       307
Power On Hours:                     440
Unsafe Shutdowns:                   63
Media and Data Integrity Errors:    0

/dev/sda: not present.

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

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

/sys/class/drm/card1/gt_min_freq_mhz         =   100 [MHz]
/sys/class/drm/card1/gt_max_freq_mhz         =  1300 [MHz]
/sys/class/drm/card1/gt_boost_freq_mhz       =  1300 [MHz]
/sys/class/drm/card1/gt_RPn_freq_mhz         =   100 [MHz] (GPU min)
/sys/class/drm/card1/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
wlo1(iwlwifi)                 : 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)
/sys/bus/pci/devices/0000:00:07.0/power/control = on   (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:07.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:0d.2/power/control = on   (0x0c0340, USB controller, thunderbolt)
/sys/bus/pci/devices/0000:00:0d.3/power/control = on   (0x0c0340, USB controller, thunderbolt)
/sys/bus/pci/devices/0000:00:0e.0/power/control = on   (0x010400, RAID bus controller, vmd)
/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:14.3/power/control = on   (0x028000, Network controller, iwlwifi)
/sys/bus/pci/devices/0000:00:15.0/power/control = on   (0x0c8000, Serial bus controller, intel-lpss)
/sys/bus/pci/devices/0000:00:15.1/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:1c.0/power/control = on   (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1d.0/power/control = on   (0x088000, System peripheral, no driver)
/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   (0x040100, Multimedia audio controller, sof-audio-pci-intel-tgl)
/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, no driver)
/sys/bus/pci/devices/0000:57:00.0/power/control = on   (0xff0000, Unassigned class [ff00], rtsx_pci)
/sys/bus/pci/devices/0000:10000:e0:1d.0/power/control = (not available) (, PCI bridge, no driver)
/sys/bus/pci/devices/0000:10000:e1:00.0/power/control = (not available) (, Non-Volatile memory controller, no driver)

+++ 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 003 ID 13d3:56eb control = auto, autosuspend_delay_ms = 2000 -- IMC Networks USB2.0 HD UVC WebCam (uvcvideo)
Bus 003 Device 007 ID 046d:c33f control = on,   autosuspend_delay_ms = 2000 -- Logitech, Inc. G815 Mechanical Keyboard (usbhid)
Bus 003 Device 010 ID 0ea0:2272 control = auto, autosuspend_delay_ms = 2000 -- Ours Technology, Inc. Pen Drive (usb-storage)
Bus 003 Device 009 ID 03f0:0867 control = auto, autosuspend_delay_ms = 2000 -- HP, Inc HP USB-C Universal Dock (no driver)
Bus 003 Device 008 ID 046d:c52b control = on,   autosuspend_delay_ms = 2000 -- Logitech, Inc. Unifying Receiver (usbhid)
Bus 003 Device 006 ID 05e3:0608 control = auto, autosuspend_delay_ms =    0 -- Genesys Logic, Inc. Hub (hub)
Bus 003 Device 004 ID 04b4:6506 control = auto, autosuspend_delay_ms =    0 -- Cypress Semiconductor Corp. CY4603 (hub)
Bus 003 Device 002 ID 04b4:6506 control = auto, autosuspend_delay_ms =    0 -- Cypress Semiconductor Corp. CY4603 (hub)
Bus 003 Device 005 ID 8087:0026 control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. AX201 Bluetooth (btusb)
Bus 003 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =    0 -- Linux Foundation 2.0 root hub (hub)
Bus 002 Device 005 ID 17e9:600a control = on,   autosuspend_delay_ms = 2000 -- DisplayLink HP USB-C Universal Dock (snd-usb-audio)
Bus 002 Device 004 ID 0bda:8153 control = auto, autosuspend_delay_ms = 2000 -- Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter (r8152)
Bus 002 Device 003 ID 04b4:6504 control = auto, autosuspend_delay_ms =    0 -- Cypress Semiconductor Corp. (hub)
Bus 002 Device 002 ID 04b4:6504 control = auto, autosuspend_delay_ms =    0 -- Cypress Semiconductor Corp. (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: asus
Supported features: charge threshold
Driver usage:
* natacpi (asus_wmi) = active (charge threshold)
Parameter value range:
* STOP_CHARGE_THRESH_BAT0/1: 0(off)..100(default)

+++ Battery Status: BAT0
/sys/class/power_supply/BAT0/manufacturer                   = ASUSTeK
/sys/class/power_supply/BAT0/model_name                     = UX425
/sys/class/power_supply/BAT0/cycle_count                    =    223
/sys/class/power_supply/BAT0/charge_full_design             =   4220 [mAh]
/sys/class/power_supply/BAT0/charge_full                    =   3354 [mAh]
/sys/class/power_supply/BAT0/charge_now                     =   2649 [mAh]
/sys/class/power_supply/BAT0/current_now                    =      0 [mA]
/sys/class/power_supply/BAT0/status                         = Not charging

/sys/class/power_supply/BAT0/charge_control_end_threshold   =     80 [%]

Charge                                                      =   79.0 [%]
Capacity                                                    =   79.5 [%]
linrunner commented 1 year ago

You are making a mistake in your reasoning. There is a section on this in the FAQ.

yarinbar commented 1 year ago

So what is the purpose of START_CHARGE_THRESH_BAT0?

Do you have an idea why tlp discharge doesnt work?

linrunner commented 1 year ago

You have to cope with what your hardware can do. ASUS laptops do not have a start charge threshold and do not have tlp discharge. Exactly what your output shows in the +++ Battery Care section and what TLP's documentation tells.

With your laptop you can only discharge by pulling the plug.

Please ask further comprehension questions in the Linux forum of your choice. The issue tracker is reserved for bug reports. Thank you.