如果 Thunderbolt 3 底座在挂起状态下拔出,则会冻结

如果 Thunderbolt 3 底座在挂起状态下拔出,则会冻结

如果我在 Ubuntu 暂停时拔下 Thunderbolt 3 底座,则下次尝试恢复时 Ubuntu 会冻结并出现黑屏。

这可以修复吗?

有一些错误和堆栈跟踪syslog

pcieport 0000:03:02.0: can't change power state from D3hot to D0 (config space inaccessible)
thunderbolt 0000:04:00.0: can't change power state from D3hot to D0 (config space inaccessible)
Call Trace:
 <TASK>
 usb_hcd_pci_remove+0xac/0x110
 xhci_pci_remove+0x72/0xb0 [xhci_pci]
 pci_device_remove+0x3b/0xb0
 __device_release_driver+0x1a8/0x2a0
 device_release_driver+0x29/0x40
 pci_stop_bus_device+0x74/0xa0
 pci_stop_bus_device+0x30/0xa0
 pci_stop_bus_device+0x30/0xa0
 pci_stop_and_remove_bus_device+0x13/0x30
 pciehp_unconfigure_device+0x7e/0x140
 pciehp_disable_slot+0x6c/0x100
 pciehp_handle_presence_or_link_change+0xb7/0x110
 pciehp_ist+0x19a/0x1b0
 ? irq_forced_thread_fn+0x90/0x90
 irq_thread_fn+0x25/0x70
 irq_thread+0xdc/0x1b0
 ? irq_thread_fn+0x70/0x70
 ? irq_thread_check_affinity+0x100/0x100
 kthread+0x127/0x150
 ? set_kthread_struct+0x50/0x50
 ret_from_fork+0x1f/0x30
 </TASK>
$ uname -r
5.15.0-52-generic

答案1

正如这里所讨论的: https://answers.launchpad.net/ubuntu/+question/704136#5 解决方法是在挂起时卸载崩溃的驱动程序,然后在恢复时重新加载,以避免崩溃。

安装此脚本(来自这里),问题已解决:

#!/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: custom-xhci_hcd - 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: custom-xhci_hcd - 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
111

相关内容