11

I'm using Ubuntu 20.04, installed it an year ago and haven't had any problems until now.

Now, when I start the computer, everything works fine related to the USB ports, but after a bit of time one of the ports stops working, and after a bit more time, another one stops working (I have 3 in total, didn't try to see what happens with the 3rd one). If I restart the computer, they all work fine at first, and then the same thing happens.

I tried with multiple cables and devices (phone, mouse, headphones), and none work.

I ran dmesg | grep -i USB and some of the messages that I get are like this: [ 484.205997] usb usb1-port3: Cannot enable. Maybe the USB cable is bad?.

Any advice on what I can do, other than reinstalling the OS?

EDIT: I have win10 installed as well, this issue happens only on Ubuntu

EDIT 2: I have found out that this happens only if I connect my phone to the port. It doesn't happen if I just keep the mouse or anything else. Could this be a problem with my phone related settings or something? Since I use it in developer mode with Android Studio, and I vaguely remember fiddling around with adb since it didn't work at first.

H-005
  • 213

5 Answers5

7

Solution posted in https://askubuntu.com/a/833569/196546 for USB 3 drivers worked for me on Ubuntu 20.04.

The directory structure looked slightly different. I had two different USB ids and I tried both before finding the one that worked.

Steps:

  1. Become Root: sudo su
  2. List /sys/bus/pci/drivers/xhci_hcd: ls -l /sys/bus/pci/drivers/xhci_hcd
total 0
lrwxrwxrwx 1 root root    0 Jan 13 11:16 0000:00:14.0 -> ../../../../devices/pci0000:00/0000:00:14.0
lrwxrwxrwx 1 root root    0 Jan 13 11:16 0000:3a:00.0 -> ../../../../devices/pci0000:00/0000:00:1c.4/0000:02:00.0/0000:03:02.0/0000:3a:00.0
--w------- 1 root root 4096 Jan 13 11:12 bind
lrwxrwxrwx 1 root root    0 Jan  9 08:09 module -> ../../../../module/xhci_pci
--w------- 1 root root 4096 Jan 13 11:08 new_id
--w------- 1 root root 4096 Jan 13 11:08 remove_id
--w------- 1 root root 4096 Jan  9 08:09 uevent
--w------- 1 root root 4096 Jan 13 11:12 unbind

  1. Unbind the enumerated USB bus devices (the symlinks starting with 0000:):
echo -n "0000:3a:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
echo -n "0000:00:14.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
  1. Rebind the USB bus devices:
echo -n "0000:3a:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind
echo -n "0000:00:14.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind

NeilenMarais
  • 1,038
  • 10
  • 17
1

It was one of my biggest issues right now as every time before a meeting when my camera turned on, or my USB stopped working including the microphone, following the answer from @NeilenMarais, I've created a simple script that I run every time I need to fix this in a hurry.

#!/bin/bash

Change to superuser

sudo su

Get the list of USB devices managed by xhci_hcd

devices=$(ls -1 /sys/bus/pci/drivers/xhci_hcd | grep '0000:')

Unbind each device

for device in $devices; do echo -n "$device" | tee /sys/bus/pci/drivers/xhci_hcd/unbind done

Bind each device

for device in $devices; do echo -n "$device" | tee /sys/bus/pci/drivers/xhci_hcd/bind done

echo "Unbinding and binding of USB devices completed."

0xdead
  • 111
0

I've got the same error after power failure in the electric grid. I have Ubuntu 18.04.3 (on INTEL NUC Barebone BOXNUC7PJYHN2 Pentium Silver J5005) and four USB external disks with USB hub with additional power supply. After power restore some disks didn't start. I just left two disks connected to USB hub and other connect to PC directly. I played some time to determine working disks combination.

0

After replacing my laptop motherboard, I was getting this issue (bad cable) with my thunderbolt 4 cable to my docking station.

The solution for me came from an update to the laptop BIOS to make it connect via thunderbolt.

I understand this is not a solution for everyone, but it can be a solution for some people.

I am mainly use Linux for my work, but I keep a Windows partition for some Windows based tasks, and the BIOS upgrade came through the Windows Upgrades.

It took a few restarts, but it solved the issue on both Windows and Linux OSs

0

I am using an AAeon UP Squared with intel atom processor, my issue was with the KVM switch I was using, as soon as I removed it the error was gone