Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
Last active January 24, 2023 07:31
Show Gist options
  • Save rockavoldy/8e3898fc4547cf3c19788be8dd59934b to your computer and use it in GitHub Desktop.
Save rockavoldy/8e3898fc4547cf3c19788be8dd59934b to your computer and use it in GitHub Desktop.
Fix RTL8111 Not working correctly in the new kernel

Fix RTL8111 Not working correctly with the new kernel (Ubuntu 22.04)

https://askubuntu.com/questions/1325854/activation-of-network-connection-failed-fixes-when-reboot-from-windows

Somehow, it's work again when i try to connect the LAN on the other ethernet devices

Fix

  1. Install r8168-dkms from apt with command sudo apt install dkms r8168-dkms to replace current module r8169
  2. Reboot
  3. If the issue still exist, then there is a chance, that this issue is from MSI/MSIX intterupt (not sure what, just a note)
  4. So, to fix the issue, put the file r8169_disable_msi inside /etc/initramfs-tools/scripts/init-top/, and change the the permission with sudo chmod a+x r8169_disable_msi
  5. When done, run sudo update-initramfs -c -k $(uname -r) and sudo update-grub, then reboot
#!/bin/sh
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817
#
# Attached is a work-around for the in-kernel driver that is as unhacky as I can make it.
# filename: r8169_disable_msi
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
disable_msi () {
for i in /sys/bus/pci/devices/*; do
if [ $(cat $i/vendor) = "0x10ec" -a $(cat $i/device) = "0x8168" ]; then
echo 0 >$i/msi_bus
fi
done
}
for x in $(cat /proc/cmdline); do
case ${x} in
r8169_disable_msi)
disable_msi
break
;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment