-
Notifications
You must be signed in to change notification settings - Fork 128
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
tlp suspend not applying AC settings? #698
Comments
Hi, matter of fact I removed applying AC settings during suspend with 1.4 [1], because it mainly delayed the suspend by 1-2 seconds without significant benefit. The actual behavior during suspend is described in the official documentation [2]. Really funny is the manpage link you quote. tlp-sleep.service was removed with 1.3 and from then on the related manpage is neither included in TLP nor the Debian or Ubuntu package [3]. You can easily check by typing man tlp-sleep.service. I can't tell you why the Debian page shows this zombie. Bottom line: I understand this issue as a request to add a workaround for your hardware/kernel problem. TLP is full of such workarounds :-(. But you're in luck, since I've already included [4] for a similar problem with AHCI Runtime PM, I'll add the solution for you as well. [1] https://github.com/linrunner/TLP/blob/main/changelog#L170 |
Btw: what I will not include is your |
@linrunner Thank you for that explanation. At least now I understand what is happening and why it is happening that way. It is perfectly fine that you will not include Is it correct to believe that after I download and use the 1.6 release (whenever that happens), then I don't need to edit the By the way, is there documentation for what the |
Of course. Please stay tuned because I'll need you to test the feature on your system. What distro do you run?
|
I'd be happy to test the feature. I run Ubuntu 22.04 LTS with kernel 5.15.0-43 on a Macbook Air 6,2 aka "Early-2014" |
Here you are: https://download.linrunner.de/packages/ The change writes default to /sys/module/pcie_aspm/parameters/policy before suspend (regardless of what is configured for Please test the suspend / resume cycle and post the output of
after resume. Via https://gist.github.com/ please. |
@linrunner Thank you. This seems to work as expected. The output of Here are a few things I had to do. Please let me know if I should not have done them.
Please let me know if you need anything else :) |
Thank you very much for testing.
This is not a feature of TLP or the package, but simply dpkg's way of dealing with configuration files in /etc. Whether the configuration is kept or not depends on the answer you give to the corresponding question of dpkg during installation. You may as well move your individual settings lines to a file in /etc/tlp.d/. After that you will no longer be bothered with questions. |
Hi @sagarbehere : TLP 1.6 Beta 1 is out and contains the fix -> #700 |
[x] I've read and accepted the Bug Reporting Howto
[ ] I've provided all required
tlp-stat
outputs via Gist (see below)I'm not sure if this is a bug or just my misunderstanding. So I'm erring on the side of caution and opening a bug report.
Describe the bug
On my laptop (Macbook Air 6,2 aka early-2014 running Ubuntu 22.04 LTS with kernel 5.15.0-43) I've set
PCIE_ASPM_ON_AC = default
andPCIE_ASMP_ON_BAT = powersave
. With this configuration, while on Battery, the laptop's NVMe drive fails immediately after resuming from suspend, with a message in the kernel logs likeThis does not happen if I configure
PCIE_ASPM_ON_BAT = default
. So I concluded that maybePCIE_ASPM_ON_BAT = powersave
is somehow too aggressive for my particular drive causing it to not "wake up" when the laptop resumes from suspend while on Battery power. This conclusion was reinforced by the fact that if the laptop is plugged in to AC power, suspend and resume works just fine. No NVMe errors.I do want to use
PCIE_ASPM_ON_BAT = powersave
while operating the laptop on battery. Without it, the laptop does not reach PC7 state and the battery drains too quickly. So I thought: maybe if I setPCIE_ASPM_ON_BAT = default
just before suspending, then the resume problem will be solved. The NVMe drive will "wake up" properly. So I went to/lib/systemd/system-sleep/
to create a pre-suspend hook which revealed the presence of this file which was already present as/lib/systemd/system-sleep/tlp
. It already has the commandstlp suspend
andtlp resume
that apparently get executed before suspend and after resume, respectively. I couldn't find any documentation for what these commands do, except for this manpage. According to that manpage,tlp suspend
should already be applying AC power settings before the laptop suspends i.e. the PCIE_ASPM_ON_AC setting should be applied (whose value I have set to 'default' for which the NVMe drive should "wake up" properly after resume). But I don't think this is happening. The NVMe drive does not wake up properly. However, if I modify thepre
line toThen everything works as expected. I hypothesize that this modified pre) line causes the PCIE_ASPM to change from 'powersave' to 'default' just before the laptop suspends.. because of which the NVMe drive resumes properly.
Now, after resuming (while on battery power), I was expecting that
cat /sys/module/pcie_aspm/parameters/policy
would continue to show [default] because that is what the pre-suspend hook set it to. Except that does not happen. After resuming,cat /sys/module/pcie_aspm/parameters/policy
showspowersave
?! I assume this is happening because thepost) tlp resume ;;
line re-applies the tlp configuration and setsPCIE_ASPM_ON_BAT = powersave
. This is consistent with what it should do according to the manpage. But then, on a similar note, the man page says that thepre tlp suspend
line should apply AC power settings and so myecho default > /sys/module/pcie_aspm/parameters/policy ;
line should not be needed. What gives? Am I understanding this correctly?Maybe
tlp suspend
is not, in fact, applying AC settings just before suspending?Expected behavior
While on battery power, before suspending, the line
tlp suspend
in/lib/systemd/system-sleep/tlp
should cause PCIE_ASPM settings to bedefault
as configured withPCIE_ASPM_ON_AC = default
. After resuming (while still on battery power), the linetlp resume
in the same file should cause PCIE_ASPM setting to bepowersave
as configured withPCIE_ASPM_ON_BAT = powersave
. The latter seems(?) to be happening, but the former is not.The text was updated successfully, but these errors were encountered: