TLP does not apply settings at boot

Hello

I blacklisted my integrated bluetooth adapter from the USB autosuspend option in TLP by modifying /etc/tlp.conf. I can see if this change is in effect by issuing sudo tlp-stat and checking that the power management of the bluetooth adapter is set to “on” (meaning no USB autosuspend) rather than “auto” (meaning USB autosuspend). Or, I can just check directly in /sys/bus/usb/devices/1-3/power/control.

The problem is that TLP does not apply this at boot, rather only when I manually issue sudo tlp start.
Note that TLP is enabled and working at boot.

My first guess is that TLP actually does apply the right setting but that then it is overwritten by some other program.

The only other power saving tool I have installed is powertop, however I only use it as a power monitor.

~
14:31:48 ⟩ inxi -Fazy
System:
  Kernel: 5.8.6-1-MANJARO x86_64 bits: 64 compiler: N/A 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 
  root=UUID=9eb44dd1-1630-4db8-8f51-9542e721051b rw pcie_aspm=force pci=noaer 
  nmi_watchdog=0 i915.modeset=1 i915.enable_fbc=1 i915.enable_psr=2 
  i915.enable_dc=2 i915.disable_power_well=1 
  Desktop: GNOME 3.36.6 tk: GTK 3.24.23 wm: gnome-shell dm: GDM 3.36.3 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: Dell product: XPS 13 9360 v: N/A serial: <filter> 
  Chassis: type: 9 serial: <filter> 
  Mobo: Dell model: 05JK94 v: A00 serial: <filter> UEFI: Dell v: 2.13.0 
  date: 11/14/2019 
Battery:
  ID-1: BAT0 charge: 47.4 Wh condition: 47.4/60.0 Wh (79%) volts: 8.4/7.6 
  model: SMP DELL TP1GT61 type: Li-poly serial: <filter> status: Full 
CPU:
  Topology: Dual Core model: Intel Core i5-7200U bits: 64 type: MT MCP 
  arch: Amber Lake family: 6 model-id: 8E (142) stepping: 9 microcode: D6 
  L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 21607 
  Speed: 600 MHz min/max: 400/3100 MHz Core speeds (MHz): 1: 638 2: 679 3: 635 
  4: 603 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel HD Graphics 620 vendor: Dell driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:5916 
  Device-2: Microdia Integrated Webcam HD type: USB driver: uvcvideo 
  bus ID: 1-5:3 chip ID: 0c45:670c 
  Display: wayland server: X.org 1.20.8 compositor: gnome-shell driver: intel 
  unloaded: modesetting alternate: fbdev,vesa display ID: 0 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.1.7 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell driver: snd_hda_intel 
  v: kernel alternate: snd_soc_skl bus ID: 00:1f.3 chip ID: 8086:9d71 
  Sound Server: ALSA v: k5.8.6-1-MANJARO 
Network:
  Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Bigfoot Networks driver: ath10k_pci v: kernel port: f040 
  bus ID: 3a:00.0 chip ID: 168c:003e 
  IF: wlp58s0 state: up mac: <filter> 
  Device-2: Qualcomm Atheros QCA61x4 Bluetooth 4.0 type: USB driver: btusb 
  bus ID: 1-3:2 chip ID: 0cf3:e300 
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 
  bus ID: 4-1.2:3 chip ID: 0bda:8153 serial: <filter> 
  IF: enp57s0u1u2 state: down mac: <filter> 
  IF-ID-1: vpn0 state: up speed: 10 Mbps duplex: full mac: N/A 
Drives:
  Local Storage: total: 953.87 GiB used: 127.53 GiB (13.4%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 vendor: A-Data model: SX8200PNP size: 953.87 GiB 
  block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 
  serial: <filter> rev: 42AZS6AC scheme: GPT 
Partition:
  ID-1: / raw size: 128.00 GiB size: 124.99 GiB (97.65%) 
  used: 29.38 GiB (23.5%) fs: ext4 dev: /dev/nvme0n1p2 
  ID-2: /home raw size: 817.36 GiB size: 803.53 GiB (98.31%) 
  used: 97.89 GiB (12.2%) fs: ext4 dev: /dev/nvme0n1p3 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 8.00 GiB used: 264.8 MiB (3.2%) 
  priority: -2 dev: /dev/nvme0n1p1 
Sensors:
  System Temperatures: cpu: 45.0 C mobo: N/A 
  Fan Speeds (RPM): cpu: 0 
Info:
  Processes: 225 Uptime: 3h 02m Memory: 7.50 GiB used: 2.55 GiB (33.9%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 clang: 10.0.1 Packages: 1469 
  pacman: 1459 lib: 366 flatpak: 10 Shell: Zsh v: 5.8 running in: tilix 
  inxi: 3.1.05 

Some idea?

Welcome to Manjaro.

Is the tlp service enabled?

$ systemctl status tlp.service

If not, enable it:

$ systemctl enable --now tlp.service

Seems like it is

~
21:47:08 ⟩ systemctl status tlp.service 
● tlp.service - TLP system startup/shutdown
     Loaded: loaded (/usr/lib/systemd/system/tlp.service; enabled; vendor preset: disabled)
     Active: active (exited) since Wed 2020-09-16 21:30:44 CEST; 16min ago
       Docs: https://linrunner.de/tlp
    Process: 615 ExecStart=/usr/bin/tlp init start (code=exited, status=0/SUCCESS)
   Main PID: 615 (code=exited, status=0/SUCCESS)

Sep 16 21:30:43 dirac systemd[1]: Starting TLP system startup/shutdown...
Sep 16 21:30:44 dirac tlp[615]: Applying power save settings...done.
Sep 16 21:30:44 dirac tlp[615]: Setting battery charge thresholds...done.
Sep 16 21:30:44 dirac tlp[615]: Radio device states restored.
Sep 16 21:30:44 dirac systemd[1]: Finished TLP system startup/shutdown.

Not really a solution but a workaround:

Turn that shit Bluetooth off and only enable it when you need it and then turn if back off. Bluetooth has had severe security issues over the years, so I’ve been running without any Bluetooth devices (Cables, baby!) over the last 10+ years…

(Yeah, it’s convenient, it’s also a security hell-hole)

:man_shrugging:

1 Like

Thanks for the suggestion, but I am using a bluetooth keyboard, so no bluetooth no typing.

Hello,

My suggestion: undo your modification to /etc/tlp.conf and use tlpui from our repository to control the settings for your devices.

Hello

even though I don’t see the point because tlpui modifies the same /etc/tlp.conf file, I did what suggested: reverted the manual changes, reinstalled tlpui and modified the settings from there.
Same result.

By the way, instead of blacklisting the device code, the same behavior is observed if I tick the USB_BLACKLIST_BTUSB option (as expected).

Furthermore, I noticed that also the wifi power management does not follow the setting after boot. This should be off when in ac mode, but right after boot it is on. Issuing sudo tlp start turns it off as it should be according to the setting (this corresponds to the WIFI_PWR_ON_AC option). What is weird here is that I have not touched this option in /etc/tlp.conf; neither manually, nor through tlpui.

Ok, we render out the possibility of a typo. Next we can try:
systemctl stop tlp
systemctl disable tlp
then
systemctl enable tlp
systemctl reboot

Ok, I did that.

Now the wifi power management work as expected, while the bluetooth not yet.

In the meantime I discovered something else: after boot, it does not matter if I am on ac or on bat mode, if I switch between the two profiles by plugging/unplugging the power chord or manually with the commands sudo tlp bat and sudo tlp ac, the bluetooth option is never picked up. The only way to make it work is to issue sudo tlp start regardless of the profile (ac/bat).

Probably a solution would be to create a script that upon boot it executes the command sudo tlp start, however I would have to grant root privileges. I don’t know if this is possible first, and good practice second.

Some suggestions?

I found the solution here: USB Autosuspend Blacklist Settings Not Applied at Boot on Ubuntu 20.04 · Issue #518 · linrunner/TLP · GitHub

Adding

X_TLP_USB_MODE=1

to /etc/tlp.conf fixed the issue.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.