1

I am using ubuntu 18.04. when I start my laptop and plug a network cable it will connect. But when I unplug the cable and then replug it won't reconnect. I have to then put the laptop in sleep mode and then it will reconnect. That means between 2 suspends the laptop will connect to the LAN port only once. If it is unplugged then make it sleep, wake up and then replug. I have figured out the problem is happening due to the installation of tlp. As soon as I install tlp this problem shows up and uninstalling it makes everything just fine. Please note that I am talking about the LAN port and not the port which we use for pendrives for file transfer. Also the problem doesn't show up in windows 10 as my laptop is dual booted

  • This may be related to network issues found in kernels 4.15.0-29 through -36, and maybe beyond. 18.10 seems to solve the problem. Why are you trying to install/use tlp? Is there a pref in tlp that might cause this? – heynnema Oct 26 '18 at 15:01
  • Well TLP highly optimises the battery. I think making some changes in the TLP file configuration might work. There must be some fix for this – Nikhil Rathore Oct 26 '18 at 15:39
  • can you figure out any change that might work – Nikhil Rathore Oct 27 '18 at 02:55
  • Boot to a Ubuntu Live 18.10 DVD/USB and see if the wired connection works better. Install tlp there too. Otherwise, I'd need to have you run through a bunch of commands to see if I can find a problem, besides tlp. And I already know of network problems with the later 18.04 kernels. – heynnema Oct 27 '18 at 03:02
  • I am having ubuntu installed. so if now I insert a bootable usb and select the option 'try ubuntu without installing' will my current ubuntu get lost. – Nikhil Rathore Oct 27 '18 at 03:46
  • No, your current Ubuntu installation is untouched. Cool huh? It allows you to boot with the USB flash, test what you want to prove/disprove if your current problem is there or not, even after installing tlp! Report back to @heynnema – heynnema Oct 27 '18 at 11:46
  • so basically you are saying to boot from a live usb without installing ubuntu. Then install tlp and check if the problem is there or not. cool? – Nikhil Rathore Oct 27 '18 at 11:49
  • Yes. Make sure to test the cable connection many times BEFORE installing tlp, 'cause of the 18.04 kernel problems that I mentioned. You might test with BOTH 18.04 AND 18.10 Ubuntu Live DVD/USB, without/with tlp. – heynnema Oct 27 '18 at 11:53

1 Answers1

1

From this Dell LAN problem with TLP: Wired network not working after resuming from suspend (Ubuntu 16.04) #222

Edit TLP configuration using: sudo -H gedit /etc/default/tlp

Locate these lines:

# Disable wake on LAN: Y/N
WOL_DISABLE=Y
  • Change "Y" to "N"

Locate your USB_BLACKLIST lines (if any) and un-blacklist them by placing # at beginning:

#USB_BLACKLIST="10ec:8168"
#USB_BLACKLIST="103c:832b"
  • Save file and exit
  • Restart TLP with command: sudo tlp start

Second option: Disable PCIe power management

From: TLP Troubleshooting:

Disable Runtime Power Management completely

Comment both related config lines with a leading '#':

#RUNTIME_PM_ON_AC=on
#RUNTIME_PM_ON_BAT=auto

When the problem disappears, uncomment above lines and continue with the next section.

Otherwise the cause is not a PCIe device – proceed to USB.


Bug Watch

Here are some related bugs that will interest R8169 users:

Mar 21, 2018 - Fix Runtime PM for r8169:

===SRU Justification===
[Impact]
r8169 stays in D0 even when no ethernet cable is plugged in. This drains lots of power (~3W). The tested laptop uses 5.5W when r8169 is in D0, 1.8W when r8169 is in D3. The power saved is substantial.

[Fix]
Improved rumtime PM logic to let the device gets suspended (D3) when the port is not in used and the link is down.

July 3, 2018 - r8169 no internet after suspending:

===SRU Justification===
[Impact]
r8169 failed to establish connection after the fix for LP: #1752772 landed.

[Fix]
Accepts BIOS WoL settings again, and disables MSI-X for certain chip revisions.

March 2, 2018 - r8169 ethernet card don't work after returning from suspension

This bug affects 127 people:

===SRU Justification===
[Impact]
Ethernet r8169 stops working after system resumed from suspend.

[Test]
User confirmed these patches fix the issue. r8169 continues to work after resume from suspend.

[Regression Potential]
Medium. The fix is limited to one device, all patches are in mainline. The WOL default change might cause regression for users that depend on BIOS settings. We can advice them to use userspace tool (systemd, ethtool, etc.) instead.

Summary

There have been quite a few bugs with r8169 in 2018. I'm using a kernel from 2017 (4.13.0-36) so I haven't experienced the same problems with TLP. It is more difficult to fix bugs I'm not experiencing. The kernel developers do have time to install new kernels, test for bugs and come up with solutions. I can do a little but, time constraints prevent installation of newer kernels.

  • Some days back I had already changed the WOL_DISABLE to N. I also commented out the 2 lines. But it didn't work – Nikhil Rathore Oct 27 '18 at 12:11
  • I've updated answer with new section to try. – WinEunuuchs2Unix Oct 27 '18 at 12:24
  • Also not in answer yet, retplug your LAN cable and then type: sudo modprobe -v -r r8169 followed by: sudo modprobe -v r8169. Does the network connect? – WinEunuuchs2Unix Oct 27 '18 at 13:55
  • I commented out the runtime power management lines. It is working fine now. I even rebooted and still it is working. After unplugging just replugging is working. No need to suspend the laptop. Basically the problem is solved. Now should I ran those commands you mentioned in the above comment – Nikhil Rathore Oct 27 '18 at 15:18
  • No. The commands in the comment were to try if it wasn't working. Glad to hear everything is working now! – WinEunuuchs2Unix Oct 27 '18 at 16:21
  • So has commenting out that 2 lines just influenced the LAN issue problem and the rest of the tlp features will continue to optimise battery life? – Nikhil Rathore Oct 27 '18 at 16:25
  • I can't speak to how fast battery drains before and after your changes. The best way is to suspend it for 1 hour and check battery percentage upon resume. Then change configuration and repeat same test (after full charge). I've been looking for a script that will display watts per hour consumed regardless of initial battery charge level and suspend time but haven't found one yet. I might have to write my own some day... – WinEunuuchs2Unix Oct 27 '18 at 16:29
  • Ok will do that. Thank you very much for all the support. I am having some more problem. My laptop is dual booted. So both windows and ubuntu show up on the start menu where I can select my os. But that is the not the case. When I start my laptop only windows show up. I have to go to bios then boot options then select ubuntu and then only ubuntu will start. Can you figure out the solution – Nikhil Rathore Oct 27 '18 at 16:39
  • That's another new question... Post all the details in a new question and other people might solve it or I might know the answer. Paste the link here and I'll have a look. You should run boot-repair first and paste a link to it's recommendation's report in your question. – WinEunuuchs2Unix Oct 27 '18 at 16:41
  • fine I will do that – Nikhil Rathore Oct 27 '18 at 16:47
  • https://askubuntu.com/questions/1087813/no-ubuntu-option-in-the-boot-menu – Nikhil Rathore Oct 27 '18 at 17:11
  • Thanks. I upvoted your question and the answer already posted. – WinEunuuchs2Unix Oct 27 '18 at 17:29