6

I've searched a lot for an answer to this, but the closest I can get to finding a solution is this, but it doesn't work for me.

Here's my system:

# uname -a
Linux vin 4.4.0-1-amd64 #1 SMP Debian 4.4.6-1 (2016-03-17) x86_64 GNU/Linux

The problem is this: one of my USB ports appears to be dead. Any program that tries to read "/sys/bus/usb/devices/usb1/descriptors" will cause the program to hang in an unkillable state.

Unfortunately, a lot of software seems to want to access USB1, including chrome and blender, which is why this is bugging me so much. When I invoke those programs with strace, they always hang at the moment they try to open "/sys/bus/usb/devices/usb1/descriptors".

I've tried things like "echo suspend > /sys/bus/usb/devices/usb1/power/level" but it's no good - the command simply hangs like the others.

I tried using the hubpower code mentioned in the post linked above, but it likewise seems to just hang like the others.

I tried powering down the whole system and opening up the computer itself to disconnect the USB port directly, but the whole collection of USB ports (there are a lot of them) seem very tightly integrated with the motherboard, and I couldn't see a way to unplug anything. Granted, I don't have tons of experience plugging wires into and out of motherboards. If the only hope is to do it that way, I could hopefully manage it.

I tried going into the BIOS and disabling all the USB ports except one; and then disabling all except the next; and the next; and so on, to see which one was the problem. But it didn't seem to have any effect - Linux still was able to recognize the ports well enough to use my USB mouse and keyboard. Linux didn't seem to care what the BIOS configuration was.

The thing that occurs to me is that there may be some way to tell the Linux kernel to ignore USB1, but to do so without actually attempting to interact with USB1 (since that seems to cause the unkillable hang). But I don't know how to do that.

  • just thinking out loud, but is there a way to blacklist hardware before the driver is loaded. Possible search terms: 'hardware module blacklist', 'modprobe blacklist', whitelist. – jc__ Apr 14 '16 at 12:46
  • Have you tried removing the device file/dir? e.g. sudo rm -rf /dev/bus/usb/001 Often you may recreate device files using MAKEDEV (man MAKEDEV, e.g sudo MAKEDEV usb, or if the kernel recreates their /dev space, by rebooting, or by noting their major/minor device numbers and using mknod directly) – arielf Apr 18 '16 at 19:43
  • I tried removing the device directory as the root user, with no luck: # rm -rf /sys/bus/usb/devices/usb1 gave "rm: cannot remove '/sys/bus/usb/devices/usb1': Operation not permitted" – Zackrobat Apr 19 '16 at 10:37
  • My mistake - I tried to remove the /sys/bus/usb/devices/usb1 file instead of your recommendation of the /dev/bus/usb/001 file. I tried the command you suggested and it worked! Thank you so much! So now the fix is simply to give that same rm command whenever I boot up. – Zackrobat Apr 19 '16 at 13:59
  • I'm a bit late to the party, but it looks as if this problem was solved? Maybe @arielf should write up his comment as answer so Zackrobat can mark it as accepted in order to get the question out of the pipeline? – domsson Apr 23 '17 at 12:19
1

Partial answer: I'm not sure if you can disable only one USB port, but you can disable the controller and all its ports.

You can list the controllers with lspci: lspci -k| grep -i usb -A2 For example, I get:

03:00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller
        Subsystem: Micro-Star International Co., Ltd. [MSI] ASM1142 USB 3.1 Host Controller
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci

Meaning the USB controller on PCI port 03:00.0 is handled by xhcp_pci kernel module.

Now, I can ask the driver not to manage this controller with the following command:

echo "0000:03:00.0" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind

If you don't mind losing the other USB ports of this controller, this could be a solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.