使用 r8168-dkms 驱动程序的 Ubuntu 18.04.3 内核崩溃

使用 r8168-dkms 驱动程序的 Ubuntu 18.04.3 内核崩溃

我使用的是 Ubuntu 18.04.3(Linux 5.0.0-32-generic),我的 Realtek PCIE 千兆以太网控制器出现内核崩溃。起初,我使用的是免费的 r8169 驱动程序,但由于它不断崩溃,我切换到了最新的 r8168-dkms 驱动程序(8.047.04-1),这似乎没有任何改变。起初我以为是硬件问题,因为我有两台完全相同的 PC,所以我更换了硬盘,但两台电脑的问题都一样。

问题总是相同的:我可以随意使用我的电脑几分钟或几小时,然后网络断开,所有输入法都卡住了,而应用程序似乎仍在运行。唯一的办法就是硬重启。

每次我都会遇到完全相同的内核恐慌,以下是日志:

nov. 05 14:54:37 hv-desktop-0 gnome-software[2531]: failed to rescan: No valid root node specified
nov. 05 14:54:39 hv-desktop-0 kernel: pci_raw_set_power_state: 25 callbacks suppressed
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:06.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:05.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:04.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:00.0: Refused to change power state, currently in D3
nov. 05 14:54:40 hv-desktop-0 sudo[3603]: pam_unix(sudo:session): session closed for user root
nov. 05 14:54:42 hv-desktop-0 gnome-software[2531]: Only 0 apps for recent list, hiding
nov. 05 14:54:43 hv-desktop-0 PackageKit[1162]: search-file transaction /643_cabbdbdd from uid 1000 finished with success after 549ms
nov. 05 14:54:43 hv-desktop-0 gnome-software[2531]: Failed to find one package for NoMachine-status-xfce.desktop, /usr/share/applications/NoMachine-status-xfce.desktop, [0]
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: cmd = 0xff, should be 0x07 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: io_base_l = 0xffff, should be 0xf001 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: mem_base_l = 0xffff, should be 0x4004 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: mem_base_h = 0xffff, should be 0xfcd0 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x1c_l = 0xffff, should be 0x0000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x1c_h = 0xffff, should be 0x0000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x20_l = 0xffff, should be 0x0004 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x20_h = 0xffff, should be 0xfcd0 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x24_l = 0xffff, should be 0x0000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x24_h = 0xffff, should be 0x0000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: ilr = 0xff, should be 0x05 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x2c_l = 0xffff, should be 0x1043 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: resv_0x2c_h = 0xffff, should be 0x8677 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: pci_sn_l = 0xffffffff, should be 0x684ce000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: pci_sn_h = 0xffffffff, should be 0x01000000 
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: enp7s0: esd_flag = 0x7fff
                                             .
nov. 05 14:54:43 hv-desktop-0 kernel: WARNING: CPU: 0 PID: 3459 at /var/lib/dkms/r8168/8.047.04/build/r8168_n.c:6824 rtl8168_wait_phy_ups_resume+0x6a/0x80 [r8168]
nov. 05 14:54:43 hv-desktop-0 kernel: Modules linked in: nls_iso8859_1 edac_mce_amd ccp kvm snd_hda_codec_realtek irqbypass snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hda_core joydev snd_hwdep amdgpu input_leds snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer crct10dif_pclmul snd crc32_pclmul soundcore ghash_clmulni_intel chash amd_iommu_v2 gpu_sched ttm drm_kms_helper drm aesni_intel aes_x86_64 i2c_algo_bit fb_sys_fops crypto_simd eeepc_wmi syscopyarea cryptd asus_wmi sysfillrect sparse_keymap sysimgblt glue_helper wmi_bmof k10temp mac_hid sch_fq_codel lm78 hwmon_vid parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid hid r8168(OE) i2c_piix4 ahci libahci wmi gpio_amdpt video gpio_generic
nov. 05 14:54:43 hv-desktop-0 kernel: CPU: 0 PID: 3459 Comm: Web Content Tainted: G           OE     5.0.0-32-generic #34~18.04.2-Ubuntu
nov. 05 14:54:43 hv-desktop-0 kernel: Hardware name: System manufacturer System Product Name/PRIME B450M-A, BIOS 1804 07/29/2019
nov. 05 14:54:43 hv-desktop-0 kernel: RIP: 0010:rtl8168_wait_phy_ups_resume+0x6a/0x80 [r8168]
nov. 05 14:54:43 hv-desktop-0 kernel: Code: 75 d8 49 8b bd 40 09 00 00 be 20 a4 00 00 e8 dd fc ff ff 41 89 c4 41 83 e4 07 eb be 83 fb 64 74 09 5b 41 5c 41 5d 41 5e 5d c3 <0f> 0b 5b 41 5c 41 5d 41 5e 5d c3 90 66 2e 0f 1f 84 00 00 00 00 00
nov. 05 14:54:43 hv-desktop-0 kernel: RSP: 0000:ffffa0bf58403de8 EFLAGS: 00010046
nov. 05 14:54:43 hv-desktop-0 kernel: RAX: 000000a3afcaa426 RBX: 0000000000000064 RCX: 0000000000000002
nov. 05 14:54:43 hv-desktop-0 kernel: RDX: 000000000037e9a7 RSI: 000000a3af92ba7f RDI: 000000000037e681
nov. 05 14:54:43 hv-desktop-0 kernel: RBP: ffffa0bf58403e08 R08: 00000000ffffffff R09: 0000000000000000
nov. 05 14:54:43 hv-desktop-0 kernel: R10: 0000000000000002 R11: 000000000000000f R12: 0000000000000007
nov. 05 14:54:43 hv-desktop-0 kernel: R13: ffffa0bf4cba8000 R14: 0000000000000003 R15: ffffa0bf4cba8940
nov. 05 14:54:43 hv-desktop-0 kernel: FS:  00007f5681197780(0000) GS:ffffa0bf58400000(0000) knlGS:0000000000000000
nov. 05 14:54:43 hv-desktop-0 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
nov. 05 14:54:43 hv-desktop-0 kernel: CR2: 00007f566282012d CR3: 00000000ce610000 CR4: 00000000003406f0
nov. 05 14:54:43 hv-desktop-0 kernel: Call Trace:
nov. 05 14:54:43 hv-desktop-0 kernel:  <IRQ>
nov. 05 14:54:43 hv-desktop-0 kernel:  rtl8168_powerup_pll+0xae/0x110 [r8168]
nov. 05 14:54:43 hv-desktop-0 kernel:  rtl8168_esd_timer+0x37c/0x650 [r8168]
nov. 05 14:54:43 hv-desktop-0 kernel:  ? rtl8168_open+0x4c0/0x4c0 [r8168]
nov. 05 14:54:43 hv-desktop-0 kernel:  call_timer_fn+0x30/0x130
nov. 05 14:54:43 hv-desktop-0 kernel:  run_timer_softirq+0x3ff/0x450
nov. 05 14:54:43 hv-desktop-0 kernel:  ? ktime_get+0x43/0xb0
nov. 05 14:54:43 hv-desktop-0 kernel:  ? lapic_next_event+0x20/0x30
nov. 05 14:54:43 hv-desktop-0 kernel:  __do_softirq+0xe4/0x2f3
nov. 05 14:54:43 hv-desktop-0 kernel:  irq_exit+0xc5/0xd0
nov. 05 14:54:43 hv-desktop-0 kernel:  smp_apic_timer_interrupt+0x79/0x140
nov. 05 14:54:43 hv-desktop-0 kernel:  apic_timer_interrupt+0xf/0x20
nov. 05 14:54:43 hv-desktop-0 kernel:  </IRQ>
nov. 05 14:54:43 hv-desktop-0 kernel: RIP: 0033:0x7f5678ba6648
nov. 05 14:54:43 hv-desktop-0 kernel: Code: 00 00 41 be 30 00 00 00 c7 44 24 4c 30 00 00 00 e9 0d fb ff ff 0f 1f 44 00 00 48 8b 54 24 08 48 8d 71 01 48 89 72 18 0f b6 29 <40> 80 fd 0b 74 3a 40 80 fd 0e 74 34 85 c0 0f 85 58 fe ff ff 83 6c
nov. 05 14:54:43 hv-desktop-0 kernel: RSP: 002b:00007ffce37b3670 EFLAGS: 00000216 ORIG_RAX: ffffffffffffff13
nov. 05 14:54:43 hv-desktop-0 kernel: RAX: 0000000000000000 RBX: 00007f5666882ee0 RCX: 00007f56634bf19e
nov. 05 14:54:43 hv-desktop-0 kernel: RDX: 00007f5666ad5820 RSI: 00007f56634bf19f RDI: 00007f56634bf1bc
nov. 05 14:54:43 hv-desktop-0 kernel: RBP: 00000000000000fb R08: 00007ffce37b37f0 R09: 00007f5678bf24d8
nov. 05 14:54:43 hv-desktop-0 kernel: R10: 00007f5666ad5800 R11: 00007f5666ad5820 R12: 0000000000000003
nov. 05 14:54:43 hv-desktop-0 kernel: R13: 0000000000000003 R14: 00007ffce37b5100 R15: 00007f5666ad4c00
nov. 05 14:54:43 hv-desktop-0 kernel: ---[ end trace 9390e7bc86428ea5 ]---
nov. 05 14:54:43 hv-desktop-0 kernel: r8168: enp7s0: link up

下面是输出sudo lshw -C network

*-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:07:00.0
       logical name: enp7s0
       version: 15
       serial: 04:d9:f5:cd:b5:aa
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.047.04-NAPI duplex=full ip=192.168.10.115 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:65 ioport:f000(size=256) memory:fcd04000-fcd04fff memory:fcd00000-fcd03fff

如果有人知道如何解决这个问题,我提前感谢您的帮助。

答案1

实际上,问题与网络驱动程序无关,而是与 PCI 管理错误有关。日志中的以下几行很重要:

nov. 05 14:54:39 hv-desktop-0 kernel: pci_raw_set_power_state: 25 callbacks suppressed
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:06.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:05.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:04.0: Refused to change power state, currently in D3
nov. 05 14:54:39 hv-desktop-0 kernel: pcieport 0000:02:00.0: Refused to change power state, currently in D3

我通过更新主板的 BIOS(华硕 PRIME B450M-A)解决了这个问题,最近的更改日志明确提到了解决 Linux 问题的方法。从那以后,再也没有出现过崩溃。

答案2

我遇到了同样的问题,@Benjamin Barrois 的帖子让我查看了我的 BIOS:PRIME B350-PLUS BIOS 4207,将其更新为 5407,清除了 r8168 驱动程序,这样就成功了!谢谢 BB

提示:dmesg | grep PRIME 将显示来自 cmd 的 bios 版本。

相关内容