A USB root hub of mine sometimes stop working: though it shows up in
lsusb, nothing happens when a device is plugged in, not even an error message in
dmesg. So I attempted to reset it by unbinding and rebinding the root hub to its underlaying PCIe interface. I ran:
printf "0000:03:00.3" > /sys/bus/pci/drivers/xhci_hcd/unbind printf "0000:03:00.3" > /sys/bus/pci/drivers/xhci_hcd/bind
0000:03:00.3 is the PCIe address of the root hub, as shown by the
iSerial field in
lsusb -v -s bus_number_of_root_hub:1.
lspci also shows similar information:
03:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 (prog-if 30 [XHCI]) Subsystem: Lenovo Raven USB 3.1
bind step above results in a
printf: write error: No such device error. But
lspci still contains
03:00.3. Also, nothing in
dmesg. I would like to know why I can't rebind this device that clearly exist, or if it's some other problem.
For comparison, the other USB root hub I have, which connects to Bluetooth and webcam, though it fails occasionally, can be reset using the above method. Also, when using Windows, nothing breaks, so I don't think anything is wrong with my hardware. I'm running Ubuntu 19.10, kernel version 5.3.0.