我如何告诉内核停止尝试激活损坏的 USB 端口?

我如何告诉内核停止尝试激活损坏的 USB 端口?

问题

我的笔记本电脑上的一个 USB 端口(1-4)坏了。由于这是硬件问题,所以我并不想修复它,我只是在寻找一种方法来告诉内核停止尝试激活它,因为它会减慢我工作的 USB 端口的激活速度。它还会减慢重启和关机的速度。

即使没有设备连接到 USB 端口,内核也会尝试激活 USB 端口。

语境

CPU 信息

$ 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 

下面是一个不断发生的事情的例子:

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

lspci:

$ 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

这里有/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

更多信息

我尝试过bash - 如何在 linux 中永久禁用特定的 usb 端口? - 堆栈内存溢出,但问题端口没有出现在 lspci 中,因此我不知道 PCI ID 是什么。

我尝试了不同的设置,但/sys/bus/usb/devices/usb1/power/wakeup/sys/bus/usb/devices/usb1/power/control无济于事。之前的命令的唯一效果是禁用了我工作的 USB 端口,这是不可取的。

我如何告诉内核停止尝试激活 USB 端口 1-4?

相关内容