How do I tell the kernel to stop trying to activate a broken USB port?

Problem

One of my USB ports (1-4) on my laptop is broken.I am not looking for a fix since it is a hardware issue, I am simply looking for a way to tell the kernel to stop trying to activate it because it is slowing down the activation of my working USB port. It also slows down reboots and shutdowns.

Context

CPU Info

$ uname -a
Linux raphael-laptop 5.17.9-1-MANJARO #1 SMP PREEMPT Wed May 18 09:20:53 UTC 2022 x86_64 GNU/Linux
$ neofetch --stdout
OS: Manjaro Linux x86_64 
Host: HP Laptop 15-dy1xxx 
Kernel: 5.17.9-1-MANJARO 
CPU: Intel i3-1005G1 (4) @ 3.400GHz 
GPU: Intel Iris Plus Graphics G1 
Memory: 3885MiB / 7639MiB 

Here is an example of what is happening endlessly:

Jun 11 10:06:44 raphael-laptop kernel: usb 1-4: device not accepting address 15, error -71
Jun 11 10:06:44 raphael-laptop kernel: usb usb1-port4: unable to enumerate USB device
Jun 11 10:06:45 raphael-laptop kernel: usb 1-4: new full-speed USB device number 16 using xhci_hcd
Jun 11 10:06:46 raphael-laptop kernel: usb 1-4: device descriptor read/64, error -71
Jun 11 10:06:46 raphael-laptop kernel: usb 1-4: device descriptor read/64, error -71
Jun 11 10:06:48 raphael-laptop kernel: usb usb1-port4: Cannot enable. Maybe the USB cable is bad?
Jun 11 10:06:48 raphael-laptop kernel: usb usb1-port4: attempt power cycle
Jun 11 10:06:50 raphael-laptop kernel: usb usb1-port4: Cannot enable. Maybe the USB cable is bad?
Jun 11 10:06:50 raphael-laptop kernel: usb 1-4: new full-speed USB device number 19 using xhci_hcd
Jun 11 10:06:50 raphael-laptop kernel: usb 1-4: Device not responding to setup address.
Jun 11 10:06:50 raphael-laptop kernel: usb 1-4: Device not responding to setup address.
Jun 11 10:06:50 raphael-laptop kernel: usb 1-4: device not accepting address 19, error -71
Jun 11 10:06:50 raphael-laptop kernel: usb usb1-port4: unable to enumerate USB device
Jun 11 10:06:51 raphael-laptop kernel: usb 1-4: new full-speed USB device number 20 using xhci_hcd
Jun 11 10:06:51 raphael-laptop kernel: usb 1-4: device descriptor read/64, error -71

Here are the /sys/bus/usb/devices:

$ ls -lha /sys/bus/usb/devices
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 usb1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 usb2 -> ../../../devices/pci0000:00/0000:00:14.0/usb2


More Information

I have tried different settings with /sys/bus/usb/devices/usb1/power/wakeup and /sys/bus/usb/devices/usb1/power/control to no avail. The only effect from the previous commands were disabling my working USB ports which is undesirable.

How do I tell the kernel to stop trying to activate USB port 1-4?

Hi @GalacticRaph,

Have you tried a udev rule? To set one up, accoring to this page:

  1. Create a new file in /lib/udev/rules.d using a text editor of your choice. For example:
sudo vi /lib/udev/rules.d/20-block-webcam.rules
  1. Revoke authorization for the webcam to be accessed:
# Chicony Webcam
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f2", ATTRS{idProduct}=="b330", ATTR{authorized}="0"
  1. Reboot

I doubt it’ll be that exactly, but it might nudge you in the correct direction.

Hope it helps!

Edit:

Else, you could try this:

sudo sed --in-place s/on/off /sys/bus/usb/devices/usb1/1-4/power/control

I have absolutely no, zero, 0 idea if this’ll work. I just got the idea here. Use it at your own risk.

1 Like

Thanks for the fast reply. I may be wrong, but I think the problem I’m having is at a lower level than the a udev solution can provide. I should have mentioned that the kernel will still try and fail to activate the USB port without a connected device. So the problem is the port itself, not a specific device. With that being said, I’ll look into udev, maybe it can help.

Thanks

Also look here:

https://stackoverflow.com/questions/27047959/how-to-disable-a-specific-usb-port-permanently-in-linux

You are wrong.
@Mirdarthos gave all informations. take it or leave it

Thank you. I stumbled upon that solution in the past and ran into an obstacle: I can’t find the PCI ID for my USB device (1-4).

My available devices are:

$ ls -lha /sys/bus/usb/devices
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-10:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 1-3:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Jun 11 09:37 usb1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1
lrwxrwxrwx 1 root root 0 Jun 11 09:37 usb2 -> ../../../devices/pci0000:00/0000:00:14.0/usb2
$ lspci
00:00.0 Host bridge: Intel Corporation Device 8a02 (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)
00:04.0 Signal processing controller: Intel Corporation Device 8a03 (rev 03)
00:14.0 USB controller: Intel Corporation Ice Lake-LP USB 3.1 xHCI Host Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Ice Lake-LP DRAM Controller (rev 30)
00:15.0 Serial bus controller: Intel Corporation Ice Lake-LP Serial IO I2C Controller #0 (rev 30)
00:15.1 Serial bus controller: Intel Corporation Ice Lake-LP Serial IO I2C Controller #1 (rev 30)
00:16.0 Communication controller: Intel Corporation Ice Lake-LP Management Engine (rev 30)
00:17.0 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 30)
00:1c.0 PCI bridge: Intel Corporation Device 34bf (rev 30)
00:1f.0 ISA bridge: Intel Corporation Ice Lake-LP LPC Controller (rev 30)
00:1f.3 Audio device: Intel Corporation Ice Lake-LP Smart Sound Technology Audio Controller (rev 30)
00:1f.4 SMBus: Intel Corporation Ice Lake-LP SMBus Controller (rev 30)
00:1f.5 Serial bus controller: Intel Corporation Ice Lake-LP SPI Controller (rev 30)
01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter

The problematic port is 1-4. On top of that, all of them are 0000:00:14.0. How would I specify the specific port?

What was the motivation behind your comment? I’m trying to discern whether you are here to help or troll…