USB disconnect, r8152, lenovo, started with Core 149

Hi Folks - I’ve been running ipfire for about a year on several platform, most recently a retasked older Intel NUC for the past 6 months. My red0 interface is a Lenovo USB Gb adapter. Starting with Core 149 the adapter appears to experience a kernel USB disconnect, which triggers subsequent deprovision of the interface and loss of networking. The system will often redetect the device, but it comes up as the next sequential USB dev and does not auto recover networking. When the kernel thinks the USB dev is offline, it’s link and transmit/rec LED’s remain active to it is still powered up.

A /etc/network restart, /etc/unbound restart restores external networking. The issue happens about once every 24-72 hours. I have not moved the USB dongle to a different USB port. I have used deoxit to clean the USB contacts. I am now running Core 150 dev and the problem just reoccured.

I can write a simple watchdog script to watch messages / dmesg to detect and recover but this is primitive. Any ideas ou there? Here are log extracts.

Thanks, Kirk

dmesg output

[56832.660468] r8152 2-4:1.0 red0: Tx status -71
[56833.212732] r8152 2-4:1.0 red0: Tx status -71
[56833.216597] r8152 2-4:1.0 red0: Tx status -71
[56833.753518] r8152 2-4:1.0 red0: Tx status -71
[56834.105481] r8152 2-4:1.0 red0: Tx status -71
[56834.134481] r8152 2-4:1.0 red0: Tx status -71
[56834.357357] r8152 2-4:1.0 red0: Tx status -71
[56834.417106] r8152 2-4:1.0 red0: Tx status -71
[56834.518615] r8152 2-4:1.0 red0: Tx status -71
[56834.664357] r8152 2-4:1.0 red0: Tx status -71
[56836.698121] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[56836.698147] usb 2-4: USB disconnect, device number 2
[67712.507211] perf: interrupt took too long (3982 > 3962), lowering kernel.perf_event_max_sample_rate to 50100
[80640.433657] usb 2-4: new SuperSpeed USB device number 3 using xhci_hcd
[80640.454674] usb 2-4: New USB device found, idVendor=17ef, idProduct=7205
[80640.454680] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[80640.454685] usb 2-4: Product: Thinkpad USB LAN
[80640.454688] usb 2-4: Manufacturer: Lenovo
[80640.454690] usb 2-4: SerialNumber: 09E213000000
[80640.590960] usb 2-4: reset SuperSpeed USB device number 3 using xhci_hcd
[80640.659493] r8152 2-4:1.0 eth0: v1.09.9
[80640.685345] r8152 2-4:1.0 red0: renamed from eth0

[root@ipfire log]# grep r8152 messages
Oct 5 10:27:11 ipfire kernel: r8152 2-4:1.0 red0: Tx status -71
Oct 5 10:27:11 ipfire kernel: r8152 2-4:1.0 red0: Tx status -108
Oct 5 10:27:11 ipfire kernel: r8152 2-4:1.0 eth0: v1.09.9
Oct 5 10:27:11 ipfire kernel: r8152 2-4:1.0 red0: renamed from eth0
Oct 5 10:33:52 ipfire kernel: r8152 2-4:1.0 red0: carrier on
Oct 5 10:46:48 ipfire kernel: r8152 2-4:1.0 red0: carrier on
Oct 5 11:19:24 ipfire kernel: r8152 2-4:1.0 red0: carrier on
Oct 6 03:06:22 ipfire kernel: r8152 2-4:1.0 red0: Tx status -71
Oct 6 09:43:10 ipfire kernel: r8152 2-4:1.0 eth0: v1.09.9
Oct 6 09:43:10 ipfire kernel: r8152 2-4:1.0 red0: renamed from eth0

Oct 6 03:06:22 ipfire kernel: r8152 2-4:1.0 red0: Tx status -71
Oct 6 03:06:24 ipfire last message repeated 9 times
Oct 6 03:06:26 ipfire kernel: usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
Oct 6 03:06:26 ipfire kernel: usb 2-4: USB disconnect, device number 2
Oct 6 03:06:26 ipfire dhcpcd[1619]: red0: carrier lost
Oct 6 03:06:26 ipfire dhcpcd[1649]: ps_bpf_recvbpf: Network is down
Oct 6 03:06:26 ipfire dhcpcd[1619]: red0: deleting route to 68.6.92.0/22
Oct 6 03:06:26 ipfire dhcpcd[1619]: red0: deleting default route via 68.6.92.1
Oct 6 03:06:26 ipfire dhcpcd.exe[17493]: red0 has been brought down (EXPIRE)
Oct 6 03:06:27 ipfire dhcpcd[1619]: red0: removing interface
Oct 6 03:06:27 ipfire dhcpcd[1619]: dhcpcd exited
Oct 6 03:06:27 ipfire ntpd[2261]: Deleting interface #4 red0, 68.6.93.127#123, interface stats: received=0, sent=0, dropped=0, active_time=56800 secs
Oct 6 03:06:30 ipfire vnstatd[1442]: Interface “red0” disabled.

Oct 6 09:43:10 ipfire kernel: usb 2-4: new SuperSpeed USB device number 3 using xhci_hcd
Oct 6 09:43:10 ipfire kernel: usb 2-4: New USB device found, idVendor=17ef, idProduct=7205
Oct 6 09:43:10 ipfire kernel: usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=6
Oct 6 09:43:10 ipfire kernel: usb 2-4: Product: Thinkpad USB LAN
Oct 6 09:43:10 ipfire kernel: usb 2-4: Manufacturer: Lenovo
Oct 6 09:43:10 ipfire kernel: usb 2-4: SerialNumber: 09E213000000
Oct 6 09:43:10 ipfire kernel: usb 2-4: reset SuperSpeed USB device number 3 using xhci_hcd
Oct 6 09:43:10 ipfire kernel: r8152 2-4:1.0 eth0: v1.09.9
Oct 6 09:43:10 ipfire kernel: r8152 2-4:1.0 red0: renamed from eth0
Oct 6 09:43:10 ipfire codel: Codel AQM has been enabled on ‘red0’.
Oct 6 09:43:15 ipfire vnstatd[1442]: Interface “red0” enabled.

[root@ipfire init.d]# ./network restart
Removing IPv4 addresses from the green0 interface… [ OK ]
Stopping dhcpcd on the red0 interface… Not running. [ WARN ]
Bringing up the green0 interface…
Adding IPv4 address 192.168.1.1 to the green0 interface… [ OK ]
Bringing up the red0 interface…
Starting dhcpcd on the red0 interface… [ OK ]
DHCP Assigned Settings for red0:
IP Address: 68.6.93.127
Hostname: ipfire
Subnet Mask: 255.255.252.0
Default Gateway: 68.6.92.1
DNS Server: 68.105.28.11 68.105.29.11 68.105.28.12
RTNETLINK answers: No such file or directory
Adding static routes… [ OK ]
Adding static routes… [ OK ]
[root@ipfire init.d]# ping kirkgrier.com
ping: kirkgrier.com: Name or service not known
[root@ipfire init.d]# ./unbound restart
Stopping Unbound DNS Proxy… [ OK ]
Starting Unbound DNS Proxy… [ OK ]
[root@ipfire init.d]# ping kirkgrier.com
PING kirkgrier.com (159.65.65.61) 56(84) bytes of data.
64 bytes from 159.65.65.61 (159.65.65.61): icmp_seq=1 ttl=55 time=26.7 ms
64 bytes from 159.65.65.61 (159.65.65.61): icmp_seq=2 ttl=55 time=30.1 ms
64 bytes from 159.65.65.61 (159.65.65.61): icmp_seq=3 ttl=55 time=24.3 ms
64 bytes from 159.65.65.61 (159.65.65.61): icmp_seq=4 ttl=55 time=28.9 ms
^C
kirkgrier.com ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3143ms
rtt min/avg/max/mdev = 24.398/27.563/30.115/2.191 ms
[root@ipfire init.d]#