TLP battery stop charge not working, Dell Inspiron

I’m currently on a Dell Inspiron 7570, with

  • OS - NixOS 26.05 (Yarara) x86_64, Linux 6.18.8.
  • Battery model - DELL W7NKD68
  • TLP version - 1.9.1
  • BIOS version - 1.25.0 (latest)

This is my TLP config.

  services.tlp = {
    enable = true;

    settings = {
      CPU_SCALING_GOVERNOR_ON_AC = "performance";
      CPU_SCALING_GOVERNOR_ON_BAT = "powersave";

      CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
      CPU_ENERGY_PERF_POLICY_ON_AC = "performance";

      CPU_MIN_PERF_ON_AC = 0;
      CPU_MAX_PERF_ON_AC = 100;
      CPU_MIN_PERF_ON_BAT = 0;
      CPU_MAX_PERF_ON_BAT = 50;

      START_CHARGE_THRESH_BAT0 = 50;
      STOP_CHARGE_THRESH_BAT0 = 80;
    };
  };

The stop charge is not respected and the battery constantly charges over 80 and charges full, till it reaches 100.

❯ sudo tlp-stat -b
--- TLP 1.9.1 --------------------------------------------

+++ Battery Care
Plugin: dell
Supported features: charge thresholds
Driver usage:
* natacpi (dell_laptop) = active (charge thresholds)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1:  50..95(default)
* STOP_CHARGE_THRESH_BAT0/1:   55..100(default)

+++ Battery Status: BAT0
/sys/class/power_supply/BAT0/manufacturer                   = Samsung SDI
/sys/class/power_supply/BAT0/model_name                     = DELL W7NKD68
/sys/class/power_supply/BAT0/cycle_count                    =      0 (or not supported)
/sys/class/power_supply/BAT0/charge_full_design             =   3100 [mAh]
/sys/class/power_supply/BAT0/charge_full                    =   3100 [mAh]
/sys/class/power_supply/BAT0/charge_now                     =   2512 [mAh]
/sys/class/power_supply/BAT0/current_now                    =   1331 [mA]
/sys/class/power_supply/BAT0/status                         = Charging

/sys/class/power_supply/BAT0/charge_control_start_threshold =     50 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold   =     80 [%]
/sys/class/power_supply/BAT0/charge_types                   = Trickle Fast Standard Adaptive [Custom]

Charge                                                      =   81.0 [%]
Capacity                                                    =  100.0 [%]

+++ Recommendations
* BAT0 charge level is above the stop threshold. Use your laptop on battery power until the battery is discharged to the stop threshold.

Apart from this I’ve also tried these methods

  • Updated the BIOS version
  • Manually changed the power management in BIOS to Custom mode with limits 50 to 80, with both the BIOS interface and smbios-battery-ctl
  • Reset to BIOS defaults and rebuilt the system again

but the issue still persists.

Also, I’m using autocpu-freq and not using power-profiles-daemon, if it’s relevant.
Is there anything Dell specific that’s causing this issue and anything else I can do to fix it?

Can you check that the config is generated correctly? cat /etc/tlp.conf iirc.

Yeah, config seems to be generated properly.

~ 
❯ cat /etc/tlp.conf         
CPU_ENERGY_PERF_POLICY_ON_AC=performance
CPU_ENERGY_PERF_POLICY_ON_BAT=power
CPU_MAX_PERF_ON_AC=100
CPU_MAX_PERF_ON_BAT=50
CPU_MIN_PERF_ON_AC=0
CPU_MIN_PERF_ON_BAT=0
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
START_CHARGE_THRESH_BAT0=50
STOP_CHARGE_THRESH_BAT0=80

In which case this is probably an issue with TLP or your device firmware, and not the nix module.

Looking at this, what tlp-stat -b is reporting looks correct for what you’ve configured.

When you did your charging for testing, did you start below 50%?

Yeah, it doesn’t work even if I start charging from below 50%.
I don’t think it’s a software/config problem. I’ll perform an embedded controller (EC) reset and report back.

Interesting, resetting the EC as you mention might work. Have you had the stop threshold working before on that device?

No, I’d never set a stop limit for this device before. This method from the Dell subreddit seemed to have worked for some people, which I think performs an EC reset. However, I tried it and the EC reset seems to have happened, but the stop limit still doesn’t work for me.

Very strange. Do you know if you have an aftermarket battery?

No, not an aftermarket.

Strange. Maybe a faulty EC or your EC doesn’t actually support this but is reporting it does? Do you have a model number for the EC?