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
  • 1
  • 2
  • 7
  • 2
    Reinstalling the OS seems a little extreme for what might be legit hardware failure or a power issue. An easy way to test if is the OS would be to boot into a live USB session and using that for a bit. If a similar message is seen, it’s hardware related and you can start with swapping USB cables – matigo Aug 20 '21 at 10:48
  • @matigo The thing with swapping usb cabbles is that I've already tried 3 different things that worked yesterday, and they work a bit now as well. They also work if I plug them in the working usb ports. I don't think it's hardware related since when I start the computer, it works perfectly for a few minutes. I'll soon try to see if this happens on windows as well, since I expect it not to happen. If it happens, then yes, I guess it's hardware related. – H-005 Aug 20 '21 at 10:58
  • You might have one/more USB devices drawing more power that what's available from the port(s). Tell me EXACTLY what USB devices you're connecting... including hubs, disks, etc. – heynnema Aug 20 '21 at 15:14
  • @heynnema It happens if I only connect one USB as well, and they are not things that would consume much: headphones, mouse & phone. And again, it worked flawlessly for like an year until yesterday. It also works when I'm using windows. So I really don't see how this wouldn't be an Ubuntu problem – H-005 Aug 21 '21 at 17:00
  • Have you booted to a Ubuntu Live DVD/USB, as was suggested yesterday, to see if the problem occurs there also? – heynnema Aug 21 '21 at 17:06
  • @heynnema I'll do that in a week or so since I am not home right now, and I don't have a usb stick with me. I'll comment here the result, sorry for not being able to respond now – H-005 Aug 22 '21 at 06:53
  • Could you please clarify in you question if it is the same device and the same port that work together under Windows but not under Linux? – Alexey May 27 '22 at 16:43

4 Answers4

3

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

  • Thanks, this happened to my with a ThinkPad X1 Yoga on Ubuntu 20.04.5 LTS and a RavPower PD Pioneer 20,000 mAh power bank with USB-C Power Delivery charging. As soon as I did the rebind/bind command it started charging! – Elijah Lynn Jun 10 '23 at 00:49
  • 1
    Note: I think you might want to chain those unbind and bind commands together into a single line in case you are using a usb keyboard and mouse. Otherwise as soon as you unbind the one the keyboard is on you won't be able to type the other commands. – raphael75 Jun 14 '23 at 00:53
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