Systemd / realtek r8169 suspend fails on wake
Posted: Aug 15, 20, 13:56 techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Location: East Coast, West Coast? I know it's one of them.
I had not had issues with the r8169 module for realtek LAN nic for a long time, but with kernel 5.7, and current systemd, bang, suddenly stopped having networking enabled on wake from suspend.
Short term, of course, you can just do the classic. First find your nic IF ID:
:: Code ::
Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169 v: kernel
port: ce00 bus ID: 03:00.0 chip ID: 10ec:8168
IF: enp2s0 state: down mac: <filter>
## then just stop and start the NIC:
sudo ifdown enp2s0
sudo ifup enp2s0
One of the answers is worth keeping because it's a clean native solution, not a sort of hacked on one:
Create file: /etc/systemd/system/fix-r8169.service
:: Code ::
Description=Fix RTL-8169 Driver on resume from suspend
ExecStartPre=/sbin/modprobe -r r8169
Then just execute:
:: Code ::sudo systemctl enable fix-r8169.service
and you should be set!! Systemd will now automagically unload-and-reload your module upon wake from suspend.
I'm not getting consistent results with this, a reboot may be required, but I had this fail when suspend / wake was more than about 12 hours apart, but it worked when wake was closer to suspend.
This is however a good place to start.
Note that with these types of fixes, if the os is ever moved to different hardware, you want to remember that you made this and remove it, and also, test on different kernels.
Back to top
All times are GMT - 8 Hours