有时 Gnome 暂停会立即恢复,纯英特尔笔记本电脑上的 ubuntu 18.04

有时 Gnome 暂停会立即恢复,纯英特尔笔记本电脑上的 ubuntu 18.04

我在一台纯英特尔 Thinkpad T480 上安装了 Ubuntu 18.04。它通常连接到几个外接显示器。如果我从电源图标中选择挂起(按住 alt),笔记本电脑将启动挂起过程,并且两个外接显示器进入挂起模式。笔记本电脑上的 LED 开始闪烁以指示挂起。但一秒钟后,笔记本电脑的 LED 又恢复为亮起状态。显示器不会再次启动,但只要移动无线鼠标,外接显示器就会打开。所以它不会进入挂起状态。

更新:

大多数情况下它都能正常工作。我想我必须看看这个,当它不起作用时,尝试找到一些日志记录

更新:journalctl | grep suspend:

 pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
Jun 17 16:57:46 moncrief kernel: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -16
Jun 17 16:57:46 moncrief kernel: PM: Device 0000:00:14.0 failed to suspend async: error -16
Jun 17 16:57:46 moncrief kernel: PM: Some devices failed to suspend, or early wake event detected

感谢 lspci,该设备

00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)

答案1

基于 Dell Inspiron 的类似问题

https://gist.github.com/ioggstream/8f380d398aef989ac455b93b92d42048

我安装在

/lib/systemd/system-sleep

这里的脚本: https://gist.github.com/timrs2998/77b3c2c2567cbd38f38cde64f1155956#file-system-sleep-xhci-sh

作者:Roberto Polli (ioggstream)

创建文件后,不要忘记

sudo chmod u+x

...

#!/bin/sh
# 
# This script should prevent the following suspend errors
#  which block suspend on Dell Inspiron laptop & Thinkpad T480. 
#
# Put it in /usr/lib/systemd/system-sleep/xhci.sh
#
# The PCI 00:14.0 device is the usb xhci controller.
#
#    kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
#    kernel: [67445.560619] dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -16
#    kernel: [67445.560624] PM: Device 0000:00:14.0 failed to suspend async: error -16
#    kernel: [67445.886961] PM: Some devices failed to suspend, or early wake event detected

if [ "${1}" == "pre" ]; then
  # Do the thing you want before suspend here, e.g.:
  echo "Disable broken xhci module before suspending at $(date)..." > /tmp/systemd_suspend_test
  grep XHC.*enable /proc/acpi/wakeup && echo XHC > /proc/acpi/wakeup
elif [ "${1}" == "post" ]; then
  # Do the thing you want after resume here, e.g.:
  echo "Enable broken xhci module at wakeup from $(date)" >> /tmp/systemd_suspend_test
  grep XHC.*disable /proc/acpi/wakeup && echo XHC > /proc/acpi/wakeup
fi

相关内容