我买了一些基于 Realtek r8152 芯片组的 USB 以太网适配器。它在我的 Debian“Stretch”下完美运行,但只有在操作系统加载后插入它时才能这样工作。如果操作系统在连接此适配器的情况下启动 - 互联网连接会持续挂起,例如每 5 秒一次,它会自动连接和断开连接。正如我所说,如果您拔下它然后再次将其插入同一个 USB 端口 - 它就会开始完美运行(完全稳定且全速)。是什么导致了这个问题?
核心:
Linux debian1 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
dmesg:
[ 12.228505] r8152: loading out-of-tree module taints kernel.
[ 12.229483] usbcore: registered new interface driver r8152
[ 12.318856] usb 3-2.4: reset high-speed USB device number 4 using ehci-pci
[ 12.485312] r8152 3-2.4:1.0 eth0: v2.09.00 (2017/08/21)
[ 12.485315] r8152 3-2.4:1.0 eth0: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[ 12.489952] usbcore: registered new interface driver cdc_ether
[ 13.054437] Adding 5858300k swap on /dev/sda5. Priority:-1 extents:1 across:5858300k FS
[ 13.107585] EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
[ 13.280075] floppy0: no floppy controllers found
[ 13.444964] r8152 3-2.4:1.0 enx00e04c68006a: renamed from eth0
[ 25.323920] IPv6: ADDRCONF(NETDEV_UP): enx00e04c68006a: link is not ready
[ 25.332487] IPv6: ADDRCONF(NETDEV_UP): enx00e04c68006a: link is not ready
[ 25.363705] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 25.363722] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c68006a: link becomes ready
[ 86.498696] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 100.536995] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 102.683454] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 119.184080] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 125.427705] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 139.526354] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 141.132447] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 157.597714] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 250.171318] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 264.170763] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 267.507029] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 281.410521] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 285.764174] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 299.674468] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 303.904214] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 317.877783] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 319.962530] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 336.371308] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
[ 338.261249] r8152 3-2.4:1.0 enx00e04c68006a: carrier off
[ 354.642913] r8152 3-2.4:1.0 enx00e04c68006a: carrier on
这些载波开启/关闭事件是连接挂起事件。
答案1
原来问题出在链接协商设置上。我刚刚在 GUI 中将其从默认的“忽略”值更改为“手动”,现在一切都稳定了。
答案2
现在是 2023 年了,我在 x86_64 CPU 架构上的 Debian 11(bullseye)中内核 v. 5.10 遇到了完全相同的问题:
[ 48.055739] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier off
[ 51.797465] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier on
[ 73.048046] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier off
[ 76.757587] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier on
[ 98.071303] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier off
[ 101.717368] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier on
[ 101.803242] r8152 4-1.2:1.0 enxd8d0900d73ec: carrier off
就我而言,改变Link Negotiation
(商業活動)选项,从默认Automatic
(萨莫钦涅) 到Skip
(波明)解决了问题!