XPS13 不会因内核 4.19 而暂停

XPS13 不会因内核 4.19 而暂停

在 Ubuntu 18.04 上安装最新内核 4.19 后,我发现我的 XPS13 不想挂起。屏幕变暗后立即又变亮。有人有解决办法吗?

答案1

虽然从技术上来说这是一个题外话,但是今天我安装了内核,却遇到了同样的问题,4.14.78-generic原因是我安装了内核来解决支持内核的挂起问题4.13.0-36-generic

我创建了这个脚本/lib/systemd/system-sleep/custom-xhci_hcd::

#!/bin/bash

# Original script was using /bin/sh but shellcheck reporting warnings.

# NAME: custom-xhci_hcd
# PATH: /lib/systemd/system-sleep
# CALL: Called from SystemD automatically
# DESC: Suspend broken for USB3.0 as of Oct 25/2018 various kernels all at once

# DATE: Oct 28 2018.

# NOTE: From comment #61 at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998

TMPLIST=/tmp/xhci-dev-list

# Original script was: case "${1}" in hibernate|suspend)

case $1/$2 in
  pre/*)
    echo "$0: Going to $2..."
    echo -n '' > $TMPLIST
          for i in `ls /sys/bus/pci/drivers/xhci_hcd/ | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
              # Unbind xhci_hcd for first device XXXX:XX:XX.X:
               echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
           echo "$i" >> $TMPLIST
          done
        ;;
  post/*)
    echo "$0: Waking up from $2..."
    for i in `cat $TMPLIST`; do
              # Bind xhci_hcd for first device XXXX:XX:XX.X:
              echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/bind
    done
    rm $TMPLIST
        ;;
esac

然后使用以下命令标记为可执行文件:

sudo chmod a+x /lib/systemd/system-sleep/custom-xhci_hcd

相关内容