I have a Thinkpad T480 and use Ubuntu 18.04.
Recently, I occassionally encounter black screen problem when I tried to wake the computer up from suspend.
The error log is:
pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
dpm_run_callback(): pci_pm_suspend+0x0/0x130 returns -16
PM: Device 0000:00:14.0 failed to suspend async: error -16
PM: Some devices failed to suspend, or early wake event detected
I found the preliminary answer from here:
https://askubuntu.com/questions/1047229/sometimes-gnome-suspend-immediately-resumes-ubuntu-18-04-on-pure-intel-laptop/1047754#1047754
And according to that post, there is an extra link talking about the USB 3.0 constroller may cause the problem: https://gist.github.com/ioggstream/8f380d398aef989ac455b93b92d42048.
So I used the script in the above link. Its basic idea is to disable the USB 3.0 constroller when suspend and enable it after wakeup.
I only modified a little bit. I only want to modify the corresponding information not to change the whole file named wakeup. The following is my modified script:
1 | #!/bin/sh |
When I run it by
1 | sudo ./xhci.sh |
it reported error
./xhci.sh: 15: [: unexpected operator
./xhci.sh: 19: [: unexpected operator
However, when I change #!/bin/sh to #!/bin/bash, it is OK.
However, both cases, the /proc/acpi/wakeup file is not modified properly. I have no idea about the solution yet.