系统崩溃 - 如何卸载 xhci_hcd 并仅允许 Ubuntu 12.04、13.04 中的 ehci_hcd 调试某些 USB 硬件

系统崩溃 - 如何卸载 xhci_hcd 并仅允许 Ubuntu 12.04、13.04 中的 ehci_hcd 调试某些 USB 硬件

我有几个使用 500mA(5V)电源的 USB 硬件,经过研究发现,外部电源或集线器是解决方案,但那是浪费时间,即使使用外部电源,问题仍然存在。

现在调试此问题的唯一方法是在 Ubuntu 12.04 或 Ubuntu 13.04 中禁用 Xhci_hcd 并保留 Ehci_hcd,因为 99% 的问题都出在这里。

但是在 Ubuntu 中禁用 xhci_hcd 几乎是不可能或不可能完成的任务,我该怎么做呢???

尝试过:

$ cd /etc/pm/config.d/
$ pwd
/etc/pm/config.d
$ ls
00sleep_module  unload_modules unload_module
root@e300gent:/etc/pm/config.d# cat *
SUSPEND_MODULES="xhci"

SUSPEND_MODULES="xhci"

SUSPEND_MODULES="xhci"

$ tail -f /var/log/syslog
Oct  6 10:47:54 e300gent kernel: [ ] xhci_hcd 0000:02:00.0: ERROR Transfer event TRB DMA ptr not part of current TD
Oct  6 10:47:54 e300gent kernel: [ ] xhci_hcd 0000:02:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk?
Oct  6 10:47:54 e300gent kernel: [ ] xhci_hcd 0000:02:00.0: ERROR Transfer event TRB DMA ptr not part of current TD

Oct  6 10:47:54 e300gent kernel: [ ] usb 3-1: USB disconnect, device number 2
Oct  6 10:48:00 e300gent kernel: [ ] usb 1-1.4: new high-speed USB device number 5 using ehci_hcd
Oct  6 10:48:00 e300gent kernel: [ ] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920 (046d:082d)
Oct  6 10:48:00 e300gent kernel: [ ] input: HD Pro Webcam C920 as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/input/input17
Oct  6 10:48:00 e300gent mtp-probe: checking bus 1, device 5: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4"

Oct  6 10:48:01 e300gent rtkit-daemon[1470]: Successfully made thread 2583 of process 1464 (n/a) owned by '1000' RT at priority 5.
Oct  6 10:48:01 e300gent rtkit-daemon[1470]: Supervising 6 threads of 1 processes of 1 users.

ehci_hcd:也丢弃该设备:

[ ] usb 1-1.4: reset high-speed USB device number 5 using ehci_hcd
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: reset high-speed USB device number 5 using ehci_hcd
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: reset high-speed USB device number 5 using ehci_hcd
[ ] usb 1-1.4: device not accepting address 5, error -110
[ ] usb 1-1.4: reset high-speed USB device number 5 using ehci_hcd
[ ] usb 1-1.4: device not accepting address 5, error -110
[ ] usb 1-1.4: USB disconnect, device number 5
[ ] usb 1-1.4: new high-speed USB device number 6 using ehci_hcd
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: device descriptor read/64, error -110
[ ] usb 1-1.4: new high-speed USB device number 7 using ehci_hcd
[ ] usb 1-1.4: device descriptor read/64, error -110

并且也在内核黑名单中,但 xhci 在 Ubuntu 中无法停用

谁能演示一些如何禁用此 xhci 的步骤,以便我可以仅通过使用 ehci 调试设备来找到确切的问题?

答案1

xhci_hcd 至少在 14.04 版中内置于内核中。您可以重新编译内核,使其成为一个模块(它位于Device Drivers | USB support内核配置菜单下,按空格键直到它变成 M,或者CONFIG_USB_XHCI_HCD=m在 .config 文件中设置)。构建完成后,您可以将其列入黑名单,并随意使用 modprobe 和 rmmod 加载和卸载。

不幸的是,我认为我的主板甚至对于 usb 2.0 也需要 xhci_hcd 并且不能仅使用 ehci_hcd,因此没有加载 xhci_hcd 模块意味着根本没有 usb(或者我需要采取进一步的步骤才能使其工作):

$ lsusb
unable to initialize libusb: -99

但是拥有一个 xhci 模块很有用,我至少可以用一些技巧重新编译它,而不必重新编译整个内核。

相关内容