Solved ue0 interface disappears when unplugging Gigabit Ethernet USB-C adapter

Problem:
I have a USB-C Gigabit Ethernet adapter that I plug into my Thinkpad to get wired LAN access. If the adapter is plugged in while the system boots up ue0 device will show up in ifconfig and everything works as expected. However once the system is running if I unplug the adapter and then plug it back in ue0 is no longer listed in ifconfig and when I run usbconfig I don't see the device listed anymore. Any ideas?

Code:
cat usbconfig-before-reboot
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <0x8086 XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.4: <vendor 0x8087 product 0x0a2b> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.5: <SunplusIT Inc Integrated Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.6: <vendor 0x06cb product 0x009a> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.7: <Generic USB3.0-CRW> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (200mA)
ugen0.2: <VIA Labs, Inc. USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <VIA Labs, Inc. USB-C Multiport Adapter> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)

Code:
cat usbconfig-after-reboot
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <0x8086 XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.2: <VIA Labs, Inc. USB3.0 Hub> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <VIA Labs, Inc. USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.3: <CMI USB 10/100/1000 LAN> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (72mA)
ugen0.3: <VIA Labs, Inc. USB-C Multiport Adapter> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
ugen0.4: <vendor 0x8087 product 0x0a2b> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.5: <SunplusIT Inc Integrated Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.6: <vendor 0x06cb product 0x009a> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.7: <Generic USB3.0-CRW> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (200mA)

Notice after the reboot ugen1.2: <VIA Labs, Inc. USB3.0 Hub> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) and ugen1.3: <CMI USB 10/100/1000 LAN> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (72mA) show up in the usbconfig list.

System:
FreeBSD 12.1-RELEASE-p7
Thinkpad X1-Carbon 6th gen
Cable Matters USB C Hub w/HDMI/80w charging, Gig ethernet
 
Look in /var/log/messages, run a tail -F /var/log/messages, then plug the device in. Any messages popping up?
 
Look in /var/log/messages, run a tail -F /var/log/messages, then plug the device in. Any messages popping up?
Nothing that is standing out to me
Code:
Jul 31 08:33:23 fail kernel: uhub_reattach_port: giving up port reset - device vanished
Jul 31 08:33:26 fail syslogd: last message repeated 2 times
Jul 31 08:33:26 fail kernel: ugen1.2: <VIA Labs, Inc. USB3.0 Hub> at usbus1 (disconnected)
Jul 31 08:33:26 fail kernel: uhub2: at uhub1, port 4, addr 1 (disconnected)
Jul 31 08:33:29 fail kernel: ugen1.3: <CMI USB 10/100/1000 LAN> at usbus1 (disconnected)
Jul 31 08:33:29 fail kernel: ure0: at uhub2, port 1, addr 2 (disconnected)
Jul 31 08:33:29 fail kernel: ue0: link state changed to DOWN
Jul 31 08:33:30 fail kernel: rgephy0: detached
Jul 31 08:33:30 fail kernel: miibus0: detached
Jul 31 08:33:30 fail dhclient[12905]: receive_packet failed on ue0: Device not configured
Jul 31 08:33:30 fail kernel: ure0: detached
Jul 31 08:33:31 fail kernel: uhub2: detached
Jul 31 08:33:32 fail kernel: uhub_reattach_port: giving up port reset - device vanished
Jul 31 08:33:32 fail kernel: uhub1: at usbus1, port 1, addr 1 (disconnected)
Jul 31 08:33:34 fail kernel: xhci1: Controller reset timeout.
Jul 31 08:33:35 fail kernel: uhub1: <0x8086 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
Jul 31 08:33:35 fail kernel: uhub1: 4 ports with 0 removable, self powered
Jul 31 08:33:37 fail kernel: uhub_reattach_port: giving up port reset - device vanished
Jul 31 08:33:48 fail kernel: ugen0.2: <VIA Labs, Inc. USB2.0 Hub> at usbus0
Jul 31 08:33:48 fail kernel: uhub2 on uhub0
Jul 31 08:33:48 fail kernel: uhub2: <VIA Labs, Inc. USB2.0 Hub, class 9/0, rev 2.10/5.33, addr 7> on usbus0
Jul 31 08:33:48 fail kernel: uhub2: MTT enabled
Jul 31 08:33:50 fail kernel: uhub2: 5 ports with 4 removable, self powered
Jul 31 08:33:51 fail kernel: ugen0.3: <VIA Labs, Inc. USB-C Multiport Adapter> at usbus0
 
Try usbconfig -u ugen1.3 reset. There might be s/th missing under /etc/devd?

It does not look like that is working, perhaps I fat fingered something?
Code:
sudo usbconfig -u ugen1.3 reset
usbconfig: ugen1.3: Invalid argument
 
Nothing that is standing out to me
You didn't notice the USB hubs getting disconnected too? It looks like your USB controller doesn't like it when the device is disconnected and reconnected.
 
You didn't notice the USB hubs getting disconnected too? It looks like your USB controller doesn't like it when the device is disconnected and reconnected.
I noticed the hub getting disconnected, but I dont think it stands out because I assume that is expected since I disconnected the hub (the hub contains the usb ethernet device, they are the same device). Perhaps I am overlooking something there?
 
I noticed the hub getting disconnected, but I dont think it stands out because I assume that is expected since I disconnected the hub (the hub contains the usb ethernet device, they are the same device). Perhaps I am overlooking something there?
You initially mentioned you only unplugged the adapter, not the whole hub. If you unplug the hub then it's expected yes. If you only unplug the adapter then the hubs shouldn't get disconnected.
 
You initially mentioned you only unplugged the adapter, not the whole hub. If you unplug the hub then it's expected yes. If you only unplug the adapter then the hubs shouldn't get disconnected.
Oh my mistake, I am not being clear. The USB hub and the USB Gig ethernet adapter are the same device USB-C Hub with HDMI. So when I unplug the ethernet adapter it is unplugging the hub.
 
usbconfig -u 1 -a 3 reset or usbconfig -u 1 reset or -u 0 which ever you want to reset. This causes the devices to be re-enumerated.
 
usbconfig -u 1 -a 3 reset or usbconfig -u 1 reset or -u 0 which ever you want to reset. This causes the devices to be re-enumerated.
I ran those commands, but it does not look like it made a difference
Code:
$ sudo usbconfig -u 1 -a 3 reset
No device match or lack of permissions.
$ sudo usbconfig -u 1 reset
$ sudo usbconfig -u 0 reset
usbconfig: could not open device: No error: 0
$ sudo usbconfig list
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <0x8086 XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <VIA Labs, Inc. USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <VIA Labs, Inc. USB-C Multiport Adapter> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
ugen0.4: <vendor 0x8087 product 0x0a2b> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.5: <SunplusIT Inc Integrated Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.6: <vendor 0x06cb product 0x009a> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.7: <Generic USB3.0-CRW> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (200mA)
 
It looks like only the hub gets initialized but not the devices that are attached to that hub. Which is probably a little tricky to do, as you need to wait for the hub to initialize and attach, then the devices connected to the hub need to be initialized and attached again. There's probably no "insert" signal coming from the devices because they're already connected. Or the "insert" is sent when the hub hasn't initialized yet and then gets lost as there's nothing yet to receive it.
 
After some more Googling I found this thread USB not working which the resolution was to add
Code:
hw.usb.xhci.xhci_port_route="-1"
to /boot/loader.conf and reboot. I added this and it does resolve the issue. I can now unplug the device and plug it back in and ue0 comes back. It takes about 1 minute for the device to get recognized again but it does indeed solve the problem.
 
Back
Top