linrunner / TLP

TLP - Optimize Linux Laptop Battery Life
https://linrunner.de/tlp
GNU General Public License v2.0
2.68k stars 128 forks source link

tlp disables eth0 when boot on battery #636

Closed YukaMax closed 2 years ago

YukaMax commented 2 years ago

[x] I've read and accepted the Bug Reporting Howto [x] I've provided all required tlp-stat outputs via Gist (see below)

Describe the bug

When I boot laptop while using battery (without connected AC) eth0 interface is in DOWN state. I can't ping router.

ip link set eth0 down/up brings up connection.

If I boot with AC plugged in eth0 is up after boot.

Expected behavior

I expected wired interface eth0 to work after reboot on battery. Because I haven't found any note in tlp.conf about disabling eth0 interface. Would be good to have ability to enable/disable wired interfaces in tlp.conf.

To Reproduce

  1. Problem occures on battery.
  2. Actions to reproduce the behaviour a) install tlp on laptop connected to LAN router b) remove power supply c) reboot or poweroff/poweron and check network
  3. Shell commands entered and their output

    reboot

ping 192.168.1.1 ping: connect: Network is unreachable

ip link show eth0 eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether 00 brd ff:ff:ff:ff:ff:ff

  1. Full output of tlp-stat via https://gist.github.com/ for all matching cases of 1 (not as file attachment, no screenshots)

https://gist.github.com/someu0/cc46b58c735cbdb9bac58d26e6943562

Additional context

It is hard to notice what causes problem and why wired interface may not work because there is no notion about this behavior in tlp.conf and problem is not visible untill next restart without power supply.

I installed tlp to save state/unblock on boot wifi. Without tlp wifi listed as blocked by rfkill.

But after install another problem appeared tlp blocks eth0 on boot with battery.

It took long time to figure out what couses problem because laptop is not always is connected to AC. It is still possible something else causes the problem and this is a coincidence because I checked this only ~8 times.

linrunner commented 2 years ago

Hi,

in general the Troubleshooting Guide will help you to narrow down the problem.

In your case I would first try to exclude the ethernet adapter from runtime pm, e.g. enter its address into RUNTIME_PM_DENYLIST.

Background: the default configuration activates runtime pm only in battery mode.

YukaMax commented 2 years ago

Configured RUNTIME_PM_DENYLIST="01:00.0" Still no connection on boot without AC

lspci | grep -w Ethernet 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)

I don't see RUNTIME_PM_DENYLIST in tlp-stat output. If it must be there. https://gist.github.com/someu0/0d4cd897bd42969e024a0876094ff6fd


Setting

RUNTIME_PM_ON_BAT=on also had no effect.

With one of those options either RUNTIME_PM_ON_BAT=on or RUNTIME_PM_DENYLIST="01:00.0" eth0 stays down after ip link set eth0 down/up. Only connecting AC enables eth0.

linrunner commented 2 years ago

don't see RUNTIME_PM_DENYLIST in tlp-stat output. If it must be there.

Maybe you didn't remove the leading # or you added a # comment to your changed parameter lines? Both will cause TLP to ignore the line.

linrunner commented 2 years ago

Due to inactivity I'll close here. Nevertheless, you are welcome to post new findings about your problem here.