일시 중지된 장치에 대해 S3/S4 상태를 설정하는 방법

일시 중지된 장치에 대해 S3/S4 상태를 설정하는 방법

커널 5.1.0-6.4-liquorix-amd64 #1 ZEN SMP PREEMPT liquidix 5.1-4ubuntu1~bionic (2019-06-03) x86_64 x86_64 x86_64 GNU/Linux가 포함된 LUbuntu 18.04가 포함된 Dell Venue 변환기가 있습니다. PBTN을 제외한 모든 장치의 깨우기를 비활성화했습니다. BIOS에서 USB PowerShare가 꺼져 있습니다.

그럼에도 불구하고, 일시 중지 후에도 노트북은 따뜻한 상태를 유지합니다. 세 가지 장치만 전원 상태를 변경하지 않습니다.

$ cat /proc/acpi/wakeup
...
EHC1      S0    *disabled
EHC2      S0    *disabled
XHC   S0    *disabled  pci:0000:00:14.0
...
journalctl -xe > JOURNAL.TXT

...
Jun 15 10:29:14 <Sys_Name> systemd-sleep[11312]: Suspending system...
-- Subject: System sleep state suspend entered
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The system has now entered the suspend sleep state.
Jun 15 10:29:14 <Sys_Name> kernel: PM: suspend entry (s2idle)
Jun 15 10:29:14 <Sys_Name> kernel: PM: Syncing filesystems ... done.
Jun 15 10:29:31 <Sys_Name> kernel: Freezing user space processes ... (elapsed 0.008 seconds) done.
Jun 15 10:29:31 <Sys_Name> kernel: OOM killer disabled.
Jun 15 10:29:31 <Sys_Name> kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jun 15 10:29:31 <Sys_Name> kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Jun 15 10:29:31 <Sys_Name> kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jun 15 10:29:31 <Sys_Name> kernel: sd 0:0:0:0: [sda] Stopping disk
Jun 15 10:29:31 <Sys_Name> kernel: Removing pn544
Jun 15 10:29:31 <Sys_Name> kernel: sd 0:0:0:0: [sda] Starting disk
Jun 15 10:29:31 <Sys_Name> kernel: mei_me 0000:00:16.0: NFC MEI VERSION: IVN 0x1 Vendor ID 0x1 Type 0x1
Jun 15 10:29:31 <Sys_Name> kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jun 15 10:29:31 <Sys_Name> kernel: ata1.00: ACPI cmd ef/**:**:**:**:**:** (SET FEATURES) succeeded
Jun 15 10:29:31 <Sys_Name> kernel: ata1.00: ACPI cmd ef/**:**:**:**:**:** (SET FEATURES) succeeded
Jun 15 10:29:31 <Sys_Name> kernel: ata1.00: configured for UDMA/133
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2: Disable of device-initiated U1 failed.
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2: Disable of device-initiated U2 failed.
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2.4: Disable of device-initiated U1 failed.
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2.4: Disable of device-initiated U2 failed.
Jun 15 10:29:31 <Sys_Name> kernel: usb 2-2.4: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Jun 15 10:29:31 <Sys_Name> kernel: OOM killer enabled.
Jun 15 10:29:31 <Sys_Name> kernel: Restarting tasks ... done.
Jun 15 10:29:31 <Sys_Name> kernel: Probing NFC pn544
Jun 15 10:29:31 <Sys_Name> kernel: pci_bus 0000:01: Allocating resources
Jun 15 10:29:31 <Sys_Name> kernel: pci_bus 0000:02: Allocating resources
...

제어되지 않는 USB LED 장난감으로 테스트한 결과 일시 중지 중에도 켜져 있는 것으로 나타났습니다. laptop-mode-tools를 설치하는 것은 도움이 되지 않습니다(일부 추가 설정이 필요할 수도 있음).

장치를 S3 또는 S4 상태로 설정하는 방법은 무엇입니까?

답변1

최근에 USB로 인해 갑자기 일시 중지가 작동을 멈췄을 때 비슷한 문제가 발생했습니다. 이 문제를 해결하기 위해 다음 스크립트를 작성했습니다.

#!/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

스크립트를 배치 /lib/systemd/system-sleep/custom-xhci_hcd하고 다음을 사용하여 실행 가능으로 표시합니다.

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

다음 재부팅 시 스크립트가 활성화됩니다.


메시지 로그 일시 중지

일시 중지 메시지를 보려면 를 여러 번 누르고 journalctl -xe누르세요 .Page Up

Jun 14 17:30:51 alien systemd-sleep[16326]: /lib/systemd/system-sleep/custom-xhci_hcd: Going
Jun 14 17:30:51 alien kernel: xhci_hcd 0000:00:14.0: remove, state 4
Jun 14 17:30:51 alien kernel: usb usb2: USB disconnect, device number 1
Jun 14 17:30:51 alien kernel: usb 2-1: USB disconnect, device number 2
Jun 14 17:30:51 alien kernel: usb 2-1.4: USB disconnect, device number 3
Jun 14 17:30:51 alien kernel: xhci_hcd 0000:00:14.0: USB bus 2 deregistered
Jun 14 17:30:51 alien kernel: xhci_hcd 0000:00:14.0: remove, state 1
Jun 14 17:30:51 alien kernel: usb usb1: USB disconnect, device number 1
Jun 14 17:30:51 alien kernel: usb 1-1: USB disconnect, device number 2
Jun 14 17:30:51 alien kernel: usb 1-1.1: USB disconnect, device number 4
Jun 14 17:30:51 alien kernel: usblp1: removed
Jun 14 17:30:51 alien kernel: usb 1-1.2: USB disconnect, device number 6

그런 다음 을 여러 번 눌러 Page Down재개 메시지를 확인하세요.

Jun 14 17:31:07 alien systemd-sleep[16326]: /lib/systemd/system-sleep/custom-xhci_hcd: Wakin
Jun 14 17:31:07 alien systemd-sleep[16326]: Selected interface 'p2p-dev-wlp60s0'
Jun 14 17:31:07 alien systemd-sleep[16326]: OK
Jun 14 17:31:07 alien systemd-sleep[16326]: /lib/systemd/system-sleep/lag-suspend.sh: Waking
Jun 14 17:31:07 alien kernel: PM: suspend exit
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: xHCI Host Controller
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus nu
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: cache line size of 128 is not supported
Jun 14 17:31:07 alien kernel: usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
Jun 14 17:31:07 alien kernel: usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumb
Jun 14 17:31:07 alien kernel: usb usb1: Product: xHCI Host Controller
Jun 14 17:31:07 alien kernel: usb usb1: Manufacturer: Linux 4.14.114-0414114-generic xhci-hc
Jun 14 17:31:07 alien kernel: usb usb1: SerialNumber: 0000:00:14.0
Jun 14 17:31:07 alien kernel: hub 1-0:1.0: USB hub found
Jun 14 17:31:07 alien kernel: hub 1-0:1.0: 16 ports detected
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: xHCI Host Controller
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus nu
Jun 14 17:31:07 alien kernel: xhci_hcd 0000:00:14.0: Host supports USB 3.0  SuperSpeed
Jun 14 17:31:07 alien kernel: usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
Jun 14 17:31:07 alien kernel: usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumb
Jun 14 17:31:07 alien kernel: usb usb2: Product: xHCI Host Controller
Jun 14 17:31:07 alien kernel: usb usb2: Manufacturer: Linux 4.14.114-0414114-generic xhci-hc
Jun 14 17:31:07 alien kernel: usb usb2: SerialNumber: 0000:00:14.0
Jun 14 17:31:07 alien kernel: hub 2-0:1.0: USB hub found
Jun 14 17:31:07 alien kernel: hub 2-0:1.0: 8 ports detected
Jun 14 17:31:07 alien eyesome[16633]: Wakeup: Called from suspend.

관련 정보