Score:3

USB Getting *Cannot enable. Maybe the USB cable is bad?* error with multiple devices, but only sometimes

in flag

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.

in flag
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
in flag
@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.
heynnema avatar
ru flag
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.
in flag
@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
heynnema avatar
ru flag
Have you booted to a Ubuntu Live DVD/USB, as was suggested yesterday, to see if the problem occurs there also?
in flag
@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
in flag
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?
Score:2
cn flag

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

ci flag
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!
in flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.