Bug 512872

Summary: Battery charge limits may have no effect on machines that have multiple "charge types" or "charging modes"
Product: [Applications] systemsettings Reporter: konton
Component: kcm_powerdevilAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kde, natalie_clarius
Priority: NOR    
Version First Reported In: 6.4.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description konton 2025-12-02 15:32:25 UTC
SUMMARY
Certain machines, such as Dell Precision 5570 and many others, have more than on "charging modes". For those machines battery charge limits, as set by e.g. Plasma / kcm_powerdevil, only apply to (I believe) the "Custom" charging mode. The default mode when the computer is shipped is "Adaptive", so setting a charge limit in Plasma will fail out of the box.

On these machines (6.17 Linux kernel) you can check the available and current charging modes thus:

# cat /sys/class/power_supply/BAT0/charge_types
Trickle Fast Standard [Adaptive] Custom

The mode can be changed by:
# echo Custom > /sys/class/power_supply/BAT0/charge_types

After which we get:
# cat /sys/class/power_supply/BAT0/charge_types
Trickle Fast Standard Adaptive [Custom]

Alternatively there is a utility called smbios-battery-ctl which is part of the tools https://github.com/dell/libsmbios but this may not be available on current distros.

STEPS TO REPRODUCE
0. Run, as root, echo Adaptive > /sys/class/power_supply/BAT0/charge_types
1. Run LANG=C systemsettings kcm_powerdevilprofilesconfig
2. Click "Advanced Power Settings"
3. Set Charge Limit to Stop = 75%, Start = 70%
4. Click Apply
5. Let the computer discharge the battery to 60%
6. Plug in a charger

OBSERVED RESULT
The battery charges to 100%

EXPECTED RESULT
The battery charges to 75%

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2
Kernel Version: 6.17.0-7-generic (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12800H
Memory: 64 Gibyte of RAM (62.5 Gibyte usable)
Graphics Processor 1: NVIDIA RTX A2000 8GB Laptop GPU
Graphics Processor 2: Intel® Iris® Xe Graphics


ADDITIONAL INFORMATION
The charging modes have other effects. Ideally choosing a power mode should be supported, and the Charge Limit settings should then be enabled in the GUI only for the modes where they have an effect.

Alternatively, just set the mode to Custom when a charge limit is set.