无 USB 3 Arch linux 3.15.1

无 USB 3 Arch linux 3.15.1

直到上次重新启动之前,我都可以使用 USB 3 端口。我不久前刚刚安装了系统,所以在那之前我一直在配置和安装驱动程序,但那是我实际上一直在进行工作的会话。我确实安装了 xf86-input-synaptics 驱动程序,但是我只是将其卸下并再次启动,看看是否会弄乱它,因为它没有回来,所以没有。现在我被困住了。我在许多论坛上看到人们遇到了问题,但该端口通常显示在 lsusb、dmesg 或 lspci 中。

lsusb:

Bus 002 Device 005: ID 047b:0011 Silitek Corp. SK-1688U Keyboard
Bus 002 Device 004: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller
Bus 001 Device 003: ID 13d3:5134 IMC Networks 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

LSPCI | grep -i USB

00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)

dmesg | grep -i USB

[    1.278138] ACPI: bus type USB registered
[    1.278159] usbcore: registered new interface driver usbfs
[    1.278167] usbcore: registered new interface driver hub
[    1.278268] usbcore: registered new device driver usb
[    1.278630] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.278904] ehci-pci 0000:00:1a.0: new USB bus registered, assigned bus number 1
[    1.291224] ehci-pci 0000:00:1a.0: USB 2.0 started, EHCI 1.00
[    1.291408] hub 1-0:1.0: USB hub found
[    1.291716] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 2
[    1.304530] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00
[    1.304982] hub 2-0:1.0: USB hub found
[    1.597732] usb 1-1: new high-speed USB device number 2 using ehci-pci
[    1.721971] hub 1-1:1.0: USB hub found
[    1.830738] usb 2-1: new high-speed USB device number 2 using ehci-pci
[    1.955115] hub 2-1:1.0: USB hub found
[    2.037276] usb 1-1.2: new high-speed USB device number 3 using ehci-pci
[    2.240377] usb 1-1.4: new high-speed USB device number 4 using ehci-pci
[    2.390210] usb 2-1.2: new high-speed USB device number 3 using ehci-pci
[    2.476044] hub 2-1.2:1.0: USB hub found
[    2.743395] usb 2-1.2.3: new low-speed USB device number 4 using ehci-pci
[    2.899768] usb 2-1.2.4: new low-speed USB device number 5 using ehci-pci
[    6.531535] scsi6 : SCSI emulation for RTS5139 USB card reader
[    6.531790] usbcore: registered new interface driver rts5139
[    6.632207] uvcvideo: Found UVC 1.00 device USB2.0 UVC 1M WebCam (13d3:5134)
[    6.636268] input: USB2.0 UVC 1M WebCam as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input15
[    6.636452] usbcore: registered new interface driver uvcvideo
[    6.636456] USB Video Class driver (1.1.1)
[    7.114946] usbcore: registered new interface driver usbhid
[    7.114954] usbhid: USB HID core driver
[    7.125179] input: Microsoft Microsoft 3-Button Mouse with IntelliEye(TM) as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.3/2-1.2.3:1.0/0003:045E:0040.0001/input/input18
[    7.125756    ] hid-generic 0003:045E:0040.0001: input,hidraw0: USB HID v1.10 Mouse [Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)] on usb-0000:00:1d.0-1.2.3/input0
[    7.126179] input: Silitek Standard USB Keyboard  as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.4/2-1.2.4:1.0/0003:047B:0011.0002/input/input19
[    7.126612] hid-generic 0003:047B:0011.0002: input,hidraw1: USB HID v1.00 Keyboard [Silitek Standard USB Keyboard ] on usb-0000:00:1d.0-1.2.4/input0

lshw-短程巴士

H/W path           Device  Class          Description
=====================================================
/0                         bus            G74Sx
/0/100/1a                  bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
/0/100/1a/1        usb1    bus            EHCI Host Controller
/0/100/1a/1/1              bus            Integrated Rate Matching Hub
/0/100/1d                  bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
/0/100/1d/1        usb2    bus            EHCI Host Controller
/0/100/1d/1/1              bus            Integrated Rate Matching Hub
/0/100/1d/1/1/2            bus            USB2.0 Hub
/0/100/1f.3                bus            6 Series/C200 Series Chipset Family SMBus Controller

到目前为止,我只是被告知该设备已损坏,因为它没有显示在任何这些设备上。现在我已经看到它起作用了,我知道它不起作用,这只是一个配置问题。

当它工作时,lsusb 的输出包括一个 fesco 驱动程序(我认为)。使用 grep 时我没有看到 fesco。

该计算机是华硕 G74sx 笔记本电脑。

任何和所有信息都值得赞赏。谢谢。

编辑:
好的,所以我不知道这有多大帮助,但我有另一台机器(运行Linux)有一个可用的USB3端口。我开始检查 xhci_hcd 和 ehci_hcd 中两者之间的差异(以防万一),发现在 /sys/bus/pci/drivers/ 中,工作系统有一个文件夹“xhci_hcd”,而非工作系统没有。一开始我心里想,“嘿,也许我可以将它从一个系统复制到另一个系统。即使作为 root,我也无法复制这些文件。很明显,系统中的其他地方出了问题。Don不知道这是否有帮助或混淆,但这是一个细节。

编辑 2:错误消息
该问题似乎与将系统置于挂起模式有关。我从实时磁盘启动,这样我就可以快速擦除任何更改。当我将机器置于挂起模式时,它通常会毫无问题地停机。当它恢复时,USB 3 工作正常。有时,会出乎意料地出现错误。一旦发生错误,我必须拔掉机器上的插头并重置我的实时磁盘才能恢复端口。

该消息持续的时间并不长,只有几毫秒,但我在相机上看到了它。

错误信息:

xhci_hcd 0000:04:00.0: PCI post-resume error -110!
xhci_hcd 0000:04:00.0: HC died; cleaning up
xhci_hcd 0000:04:00.0: HC died; cleaning up
dpm_run_callback(): pci_pm_resume+0x0/0xb0 returns -110
PM: Device 0000:04:00.0 failed to resume async: error -110
dpm_run_callback(): usb_dev_resume+0x0/0x20 [usbcore] returns -5
PM: Device 4-1.4 failed to resume async: error -5

编辑3:可能的答案? (需要测试)阅读,我发现如果我手动解绑usb3然后调用systemctl suspend,那么当我唤醒它并手动绑定usb3设备时,它就可以工作了。我运行了 150 次,如果你认为它通常会失败 2 到 10 次,那么与平均值的标准差就足够了,所以我假设它有效。我将绑定和取消绑定放入“/etc/pm/sleep.d/20_custom-xhci_hcd”中。然后检查以确保它是可执行的。

#!/bin/sh
#File: "/etc/pm/sleep.d/20_custom-xhci_hcd"

case "${1}" in
    hibernate|sleep)
        #unbind
        echo "Unbinding xhci device"
        echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
    ;;
    resume|thaw)
        # bind
        echo "Binding xhci device"
        ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
    ;;
esac

我认为这个文件不会被调用,因为我从未看到回显输出。想一想,这是有道理的,因为这台机器没有 pm-utils,而是使用 systemd。所以我将其移至 /usr/lib/systemd/system-sleep/ 按照这个网站并将其调整为:

#!/bin/sh
#File: "/usr/lib/systemd/system-sleep/xhci_hcd.sleep"

case $1/$2 in
    pre/*)
        #unbind
        echo "Unbinding xhci device"
        echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
    ;;
    post/*)
        # bind
        echo "Binding xhci device"
        ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
    ;;
esac

如同一网站所述。然后将其设置为可执行。我要测试一下,但我想我感受到了爱。如果有效,我会将其发布到答案部分。

答案1

寻找设备
首先,我们需要找出设备编号。如果端口已启用并且您可以使用命令看到它,lsusb则使用ls /sys/bus/pci/drivers/xhci_hcd。该设备将是 xxxx:xx:xx.x 格式的数字,并且很可能是从命令返回的第一个条目ls

重置端口
如果端口不可见,则意味着该端口未工作,但可以通过断开机器的所有电源来重置。关闭计算机,取出所有电池和电源线,然后等待 10 秒钟。然后重新插入电源线并启动机器。然后再次查找设备号。

我的设备编号是 0000:04:00.0,但可能会有所不同。我在其他地方看到的一个例子是 0000:00:14.0。记住或写下您的号码。我们需要它来进行绑定和解除绑定。如果您有多个 USB 3 端口,则可能不止一个。

确定电源管理框架
为了apt/能力/dpkg(ubuntu/debian/mint):
dpkg --get-selections | grep pm-utils
如果有东西被退回,你可以pm。

为了吃豆人包管理器(arch)
pacman -Qe | grep pm-utils
如果有东西被退回,你有pm。

为了rpm 包管理器(fedora、centos 等...):
rpm -qa | grep pm-utils
如果有东西被退回,你可以pm。

为了其他的,你可以尝试这些,我不知道它们是如何工作的,也没有系统来测试它们。

笔记:仅仅因为安装的软件包并不意味着您正在使用它,但您很有可能正在使用它。您可以做的另一件事很简单cd /etc/pm/,如果存在,您可以将脚本放在那里。从技术上讲,我认为在这两个地方都有解除绑定脚本没有什么问题。如果有人想评论这是否属实,或者是否有更好的方法来确定是否使用 pm,那就太棒了。

systemd 暂停脚本(无 pm 实用程序)
如果您在没有 pm 的情况下使用 systemd 或 systemctl,我们需要将脚本放入/usr/lib/systemd/system-sleep/xhci_hcd.sleep.对于我的机器,脚本如下所示:

#!/bin/sh
#File: /usr/lib/systemd/system-sleep/xhci_hcd.sleep

case $1/$2 in
        pre/*)
                # Unbind
                echo "Unbinding xhci Device"
                echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
        ;;
        post/*)
                # bind xhci_dev
                echo "Rebinding xhci Device"
                echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
        ;;
esac

在这两种情况下,将 0000:04:00.0 替换为您的设备编号。如果您有多个设备编号,请为每个设备运行绑定和取消绑定。即,如果您有端口 xxxx:xx:xx.x 和 yyyy:yy:yy.y,您将需要echo -n "xxxx:xx:xx.x" > /sys/bus/pci/drivers/xhci_hcd/unbindecho -n "yyyy:yy:yy.y" > /sys/bus/pci/drivers/xhci_hcd/unbind取消绑定这两个设备,并使用echo -n "xxxx:xx:xx.x" > /sys/bus/pci/drivers/xhci_hcd/bindecho -n "yyyy:yy:yy.y" > /sys/bus/pci/drivers/xhci_hcd/bind绑定设备。我放置第一个 echo 命令是为了让我们在使用 . 查看日志时看到绑定和解除绑定何时发生journalctl -b -u systemd-suspend。更多信息:能源管理使用 systemd/systemctl。保存该文件然后运行sudo chmod a+x /usr/lib/systemd/system-sleep/xhci_hcd.sleep以使其可执行。我个人会重新启动系统以确保新文件生效,但我相信它可能会立即生效。如果没有,并且您让系统进入睡眠状态(或挂起/休眠),请查看如何重置上面的端口。

pm 挂起脚本(pm utils 已安装)
如果您使用 pm utils,我们需要将脚本放入/etc/pm/sleep.d/20_custom-xhci_hcd

#!/bin/sh
#File: "/etc/pm/sleep.d/20_custom-xhci_hcd"

case "${1}" in
    hibernate|sleep)
        #unbind
        echo "Unbinding xhci device"
        echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
    ;;
    resume|thaw)
        # bind
        echo "Binding xhci device"
        ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
    ;;
esac

在这两种情况下,将 0000:04:00.0 替换为您的设备编号。如果您有多个设备编号,请为每个设备运行绑定和取消绑定。请参阅 systemd 挂起脚本的脚本下面的说明,但改为使用chmod a+x /etc/pm/sleep.d/20_custom-xhci_hcd以使文件可执行。然后重新启动并测试它。

更多有用的资源:

相关内容