偶尔我的鼠标/键盘会花很长时间来响应输入。如果我移动鼠标或按下某个键,它就会花一秒钟才能正常工作。
如果我把它放置一段时间,它就会再次发生。
在 dmesg 日志中我看到这样的条目
dmesg | tail
ehci_hcd 0000:00:1d.0: PCI INT A disabled
ehci_hcd 0000:00:1d.0: PME# enabled
ehci_hcd 0000:00:1d.0: BAR 0: set to [mem 0xd9105800-0xd9105bff] (PCI address [0xd9105800-0xd9105bff])
ehci_hcd 0000:00:1d.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
ehci_hcd 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900002)
ehci_hcd 0000:00:1d.0: PME# disabled
ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21
ehci_hcd 0000:00:1d.0: setting latency timer to 64
我找到了是哪个设备,但仍然不知道问题到底是什么。我知道这与 USB 控制器有关。
lspci -n | grep 00:1d.0
00:1d.0 0c03: 8086:3b34 (rev 05)
lspci -d 8086:3b34
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
更新
经过一番调查后,我相信这与设备的电源管理、省电或自动挂起有关。
答案1
经过一番谷歌搜索后,我记得我已经安装了午睡。
sudo powernap-action -l
[disabled] 01cpu_online - sh: 1: /etc/pm/power.d/01cpu_online: Permission denied
[enabled] 00flag -
[disabled] usb - sh: 1: /etc/pm/power.d/usb: Permission denied
[disabled] video - sh: 1: /etc/pm/power.d/video: Permission denied
[disabled] eth_speed - sh: 1: /etc/pm/power.d/eth_speed: Permission denied
[enabled] usb_autosuspend - Auto suspend USB bus to save power.
[enabled] cpu_frequency - Lowers the CPU frequency, changing the scaling governor from ondemand to powersave.
[disabled] kms_powermode - sh: 1: /etc/pm/power.d/kms_powermode: Permission denied
我启用的选项之一是
[enabled] usb_autosuspend - Auto suspend USB bus to save power.
因此我通过禁用 usb_autosuspend 解决了这个问题。
sudo powernap-action --disable usb_autosuspend
所以现在
[disabled] usb_autosuspend - sh: 1: /etc/pm/power.d/usb_autosuspend: Permission denied