我正在运行带有 Xenial 内核(4.4.0-89-generic)的 Ubuntu 14.04.5。我有一个 USB 鼠标和有线键盘鼠标,它们不能很好地支持运行时电源管理(当启用运行时电源管理时,它们会丢失按键和鼠标点击)。最近,它们开始给我带来问题,几分钟后它们就停止工作了,但通常是在我几秒钟到一分钟不使用它们时。当这种情况发生时,我无法唤醒它们,除非拔下它们并重新插入它们。
排除问题:
- 我已通过 sysfs 禁用自动暂停功能。
- 我已经将 laptop-mode-tools、pm-utils 和 powertop 全部删除了。
有趣的是,这种情况仅当外围设备连接到我的戴尔 TB16 底座时才会发生,而直接连接到笔记本电脑时则不会发生。也许这不是运行时电源管理问题,而是底座问题。
有问题的设备是 Razor 键盘和 Logitech 鼠标
$ lsusb
Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp.
Bus 004 Device 002: ID 0424:5537 Standard Microsystems Corp.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0bda:4014 Realtek Semiconductor Corp.
Bus 003 Device 007: ID 1532:011c Razer USA, Ltd
Bus 003 Device 006: ID 046d:c069 Logitech, Inc. M-U0007 [Corded Mouse M500]
Bus 003 Device 002: ID 0424:2137 Standard Microsystems Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04f3:21d5 Elan Microelectronics Corp.
Bus 001 Device 004: ID 0a5c:6410 Broadcom Corp.
Bus 001 Device 006: ID 1bcf:2b95 Sunplus Innovation Technology Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
以下是层次结构显示,显示它们连接到总线 3 端口 1.3 和 1.4 上的 TB16 端口复制器
$ lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/7p, 5000M
|__ Port 2: Dev 3, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/7p, 480M
|__ Port 3: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 7, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 5: Dev 4, If 0, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 4, If 1, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 4, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 4, If 3, Class=Audio, Driver=snd-usb-audio, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
|__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=btusb, 12M
|__ Port 4: Dev 4, If 1, Class=Vendor Specific Class, Driver=btusb, 12M
|__ Port 4: Dev 4, If 2, Class=Vendor Specific Class, Driver=btusb, 12M
|__ Port 4: Dev 4, If 3, Class=Application Specific Interface, Driver=, 12M
|__ Port 9: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 12: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 12: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
这是所有 USB 设备的 sysfs:
$ for i in */power/{control,autosuspend}; do echo $i; cat $i; done
1-12/power/control
on
1-4/power/control
on
1-9/power/control
on
3-1.3/power/control
on
3-1.4/power/control
on
3-1.5/power/control
on
3-1/power/control
on
4-1.2/power/control
on
4-1/power/control
on
usb1/power/control
on
usb2/power/control
on
usb3/power/control
on
usb4/power/control
on
1-12/power/autosuspend
-1
1-4/power/autosuspend
-1
1-9/power/autosuspend
-1
3-1.3/power/autosuspend
-1
3-1.4/power/autosuspend
-1
3-1.5/power/autosuspend
-1
3-1/power/autosuspend
-1
4-1.2/power/autosuspend
-1
4-1/power/autosuspend
-1
usb1/power/autosuspend
-1
usb2/power/autosuspend
-1
usb3/power/autosuspend
-1
usb4/power/autosuspend
-1
调试此问题的最佳方法是什么?哪些日志是相关的?是否有任何实用程序可以帮助阐明这一点?