Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: add a 'lower power adapter' mode. #494

marcmerlin opened this issue May 28, 2020 · 8 comments

RFE: add a 'lower power adapter' mode. #494

marcmerlin opened this issue May 28, 2020 · 8 comments


Copy link

marcmerlin commented May 28, 2020

Currently, there is a battery mode and AC mode.
On bigger laptops like thinkpad P73, the power adapter is as big as 230W (!)
(this is without counting broken design where the laptop actively tries to reject any power supply smaller than 170W even if it only needs 40W at the moment, details and hardware workaround here: )

There is a need where you get external power, but you want to limit use over the charging plug:

  • because you are using an external battery pack
  • because you're plugged into an airplane with limited wattage
  • similarly you're using a car 12V adapter and many cars limit that power to 100W
  • or even you're using a 90W adapter with a laptop that could use 150W or more if it runs at full power and tries to charge the battery.

So, it would be great to have a power mode for 'limited AC draw' to handle any of the cases above. It would be hard to auto detect via udev, but you could just run the command from the command line after plugging in the power supply.

Copy link

linrunner commented May 28, 2020


thanks for your suggestion.

I have no plans to introduce a third power profile besides AC an BAT.

It would require a third line for the majority of settings and in addition, would clutter up the documentation and require really extensive code changes.

By contrast I estimate the number of potential users to be very small, but the impact would affect the whole user base.

Apart from that I have my doubts if an effective solution is possible solely based on kernel settings without supporting changes in Lenovo's firmware. If you look at how Lenovo has (finally) messed up the Intel DPTF topic, there's little hope for that.

Copy link

marcmerlin commented May 28, 2020

no problem, I'll just hack up something on my side, thanks for tlp

Copy link

marcmerlin commented May 28, 2020

If anyone finds this bug and needs to do the same thing than me, here's what I did

  1. 2 config files with a small diff to force battery mode even when on limited AC and mostly turn off battery charging
  2. ln -snf correctconfig tlp.conf; tlp start

hope this helps someone

sauron:/etc# diff -u tlp.conf.sauron.lowpower tlp.conf.sauron.power
--- tlp.conf.sauron.lowpower	2020-05-31 09:24:55.437014708 -0700
+++ tlp.conf.sauron.power	2020-05-31 08:05:43.779303327 -0700
@@ -33,13 +33,13 @@
 # Concerns some desktop and embedded hardware only.
 # Default: <none>
 # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
 # Note: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
 # Default: 0
 # Power supply class to ignore when determining operation mode: AC, BAT.
 # Note: try on laptops where operation mode AC/BAT is incorrectly detected.
@@ -78,9 +78,7 @@
 # Default: <none>
-# TUNE ME to, go faster
 # Set the min/max frequency available for the scaling governor.
@@ -91,8 +89,7 @@
-# TUNE ME to, go faster
 # Set Intel CPU energy/performance policies HWP.EPP and EPB:
@@ -107,7 +104,8 @@
 # Default: balance_performance (AC), balance_power (BAT)
 # FIXME performance for higher perf
 # FIXME balance-power
@@ -442,7 +440,7 @@
 # Main / Internal battery (values in %)
 # Default: <none>
 # Ultrabay / Slice / Replaceable battery (values in %)

Copy link

linrunner commented May 29, 2020

A simpler and (imho) more robust approach (no config change necessary) would be to use manual mode:

tlp bat

This will persist until the next reboot or

tlp start

The charge thresholds may be changed with

tlp setcharge 15 80

linrunner added a commit to linrunner/tlp-doc that referenced this issue May 29, 2020
Copy link

marcmerlin commented May 29, 2020

@linrunner I thought about this, but there are 2 issues:

  1. if the laptop is drawing just a bit too much, it will occasionally quick out the power supply and reconnect to it as it recovers, causing power plug/unplug events. This would revert to high power mode until I type 'tlp bat' every time
  2. more of an issue, if the laptop is fully running and tries to charge batteries, it can use over 100W which will instantly reject the power supply that can't keep up, faster than I can type 'tlp bat'
    For one, battery charging cannot be on for any amount of time, of that will cause up to an extra 100W of load as it's a big battery and a fast charger. but even without the battery charging, the laptop will use triple the amount of power if I don't throttle all the chips down.

So basically the 2 config file and symlink trick is the only thing I could get to work.

Copy link

linrunner commented May 29, 2020

Which TLP version do you use?

Manual mode will survive power unplug/plug events and even a suspend/resume cycle since TLP 1.2.

The same applies to the thresholds unless you configured RESTORE_THRESHOLDS_ON_BAT=1.

Copy link

marcmerlin commented May 31, 2020

@linrunner I have 1.3.1-2, but I don't think I was clear, let me explain

  1. I'm on batteries, laptop is happily running with 15W
  2. I plug in a 90W power supply, tlp switches to power mode, spins up all the CPUs, puts the batteries to charging, laptop tries to draw 150W (yes, it does that), power supply fails, dips voltage, laptop goes back on batteries
  3. and it bounces back and forth at 1Hz or more, quicker than I can type 'tlp bat' when on AC mode

the only way around this is to have another power mode that does not spin up everything and take so much power. This is why I made 2 config files with 2 different settings for AC.

Copy link

linrunner commented Jun 3, 2020

I think you'd best try what I suggested, step by step:

  1. You're on battery, TLP is in auto mode, BAT profile is active

  2. You select manual mode with

    sudo tlp bat
  3. You plugin the 90W power supply

  4. Because TLP is in manual mode, BAT profile sticks (until reboot or tlp start)

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

No branches or pull requests

2 participants