Realtek r8168/8111 driver

Hi,

How can one install a kernel module in Endless OS?
Our laptops have Realtek R8168 network cards, which is the very popular chipset. At the same time, Linux support for it (using r8169.ko) is very buggy (there are tons of info on the Internet about this topic) and the only way to fix the unstable network is to compile the proprietary driver from Realtek website.

Searched the Internet and found that r8169 is improved nowadays, and that r8168 driver usually doesn’t solve my problem, which is:

[ 1276.876250] ------------[ cut here ]------------
[ 1276.876254] NETDEV WATCHDOG: enp1s0 (r8169): transmit queue 0 timed out
[ 1276.876292] WARNING: CPU: 3 PID: 0 at /usr/src/packages/BUILD/linux-4.15.0/net/sched/sch_generic.c:323 dev_watchdog+0x222/0x230
[ 1276.876293] Modules linked in: rfcomm cmac bnep zram joydev edac_mce_amd kvm_amd kvm irqbypass crct10dif_pclmul crc32_pclmul hp_wmi wmi_bmof sparse_keymap ghash_clmulni_intel pcbc uvcvideo aesni_intel arc4 videobuf2_vmalloc aes_x86_64 crypto_simd glue_helper cryptd videobuf2_memops videobuf2_v4l2 videobuf2_core btusb btrtl iwlmvm btbcm btintel videodev mac80211 input_leds media bluetooth psmouse iwlwifi ecdh_generic fam15h_power snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi r8169 snd_hda_intel k10temp mii cfg80211 i2c_piix4 snd_hda_codec snd_hda_core wmi snd_hwdep snd_pcm snd_timer snd soundcore i2c_scmi shpchp hp_wireless mac_hid ip_tables x_tables amdkfd amd_iommu_v2 amdgpu chash i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops serio_raw ttm drm ahci libahci
[ 1276.876334]  video
[ 1276.876338] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.15.0-15-generic #16+dev162.f9c68bfbeos3.4.2-Endless
[ 1276.876338] Hardware name: HP HP Laptop 15-bw0xx/8333, BIOS F.13 09/07/2017
[ 1276.876340] RIP: 0010:dev_watchdog+0x222/0x230
[ 1276.876341] RSP: 0018:ffff9a1c69d83e58 EFLAGS: 00010286
[ 1276.876342] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
[ 1276.876343] RDX: 0000000000000007 RSI: 0000000000000082 RDI: ffff9a1c69d96490
[ 1276.876344] RBP: ffff9a1c69d83e88 R08: 0000000000000001 R09: 0000000000000449
[ 1276.876344] R10: ffff9a1c69d9a770 R11: 0000000000000449 R12: 0000000000000001
[ 1276.876345] R13: ffff9a1c610e4000 R14: ffff9a1c610e4478 R15: ffff9a1c5d067680
[ 1276.876347] FS:  0000000000000000(0000) GS:ffff9a1c69d80000(0000) knlGS:0000000000000000
[ 1276.876348] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1276.876348] CR2: 00002ad026d0aff0 CR3: 00000000c0f08000 CR4: 00000000001406e0
[ 1276.876349] Call Trace:
[ 1276.876351]  <IRQ>
[ 1276.876355]  ? dev_deactivate_queue.constprop.33+0x60/0x60
[ 1276.876357]  call_timer_fn+0x32/0x130
[ 1276.876359]  run_timer_softirq+0x1dd/0x430
[ 1276.876361]  __do_softirq+0x109/0x29b
[ 1276.876363]  irq_exit+0xb6/0xc0
[ 1276.876364]  smp_apic_timer_interrupt+0x71/0x130
[ 1276.876365]  apic_timer_interrupt+0x84/0x90
[ 1276.876366]  </IRQ>
[ 1276.876368] RIP: 0010:cpuidle_enter_state+0xa8/0x2e0
[ 1276.876369] RSP: 0018:ffffb43e406e3e58 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11
[ 1276.876370] RAX: ffff9a1c69da2800 RBX: 0000000000000002 RCX: 000000000000001f
[ 1276.876371] RDX: 000001294bc02d8f RSI: fffffffe9fd29566 RDI: 0000000000000000
[ 1276.876372] RBP: ffffb43e406e3e90 R08: 00000000000007e7 R09: 0000000000000018
[ 1276.876372] R10: ffffb43e406e3e28 R11: 0000000000000438 R12: ffff9a1c5e24a200
[ 1276.876373] R13: ffffffff9a37f478 R14: 000001294bc02d8f R15: ffffffff9a37f460
[ 1276.876375]  ? cpuidle_enter_state+0x97/0x2e0
[ 1276.876376]  cpuidle_enter+0x17/0x20
[ 1276.876378]  call_cpuidle+0x23/0x40
[ 1276.876379]  do_idle+0x19a/0x200
[ 1276.876381]  cpu_startup_entry+0x73/0x80
[ 1276.876383]  start_secondary+0x1a6/0x200
[ 1276.876384]  secondary_startup_64+0xa5/0xb0
[ 1276.876385] Code: 38 00 49 63 4e e8 eb 92 4c 89 ef c6 05 85 52 d9 00 01 e8 72 2d fd ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 18 f3 f9 99 e8 3e 08 81 ff <0f> 0b eb c0 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48
[ 1276.876407] ---[ end trace 12e918e10f903653 ]---

Then the network stops working completely until reboot, or modprobe -r r8169 && modprobe r8169.
What else can be done to fix the issue?

I also have this in logs:

amdgpu 0000:05:00.0: GPU pci config reset

maybe it’s related somehow

Ok, seem that pnpacpi=off boot option resolves the issue in my case. Now I’m looking for the conventional way to make these boot options permanent. For now, I updated /boot/loader/entries/ostree-eos-*.conf files, but I’m looking for a way to make it survive the update.

I was wrong, it didn’t help, nor any noacpi options. Still looking for a solution.

Here is how I fixed the issue: How to install Realtek's proprietary r8168.ko module driver

I hope Endless OS team will include r8168 driver along with other ones (like nVidia) that are already included.