Como definir o estado S3/S4 para dispositivos suspensos

Como definir o estado S3/S4 para dispositivos suspensos

Eu tenho o transformador Dell Venue com LUbuntu 18.04 com o kernel 5.1.0-6.4-liquorix-AMD64 #1 ZEN SMP PREEMPT liquorix 5.1-4ubuntu1~bionic (03/06/2019) x86_64 x86_64 x86_64 GNU/Linux. Desativei a ativação por todos os dispositivos, exceto PBTN. No BIOS, o USB PowerShare está desligado.

No entanto, após a suspensão, o laptop permanece quente. Apenas três dispositivos não alteram o estado de energia:

$ 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
...

O teste com brinquedos LED USB não controlados mostra que eles permanecem ligados durante a suspensão. Instalar ferramentas no modo laptop não é útil (possivelmente, algumas configurações adicionais são necessárias).

Como configurar os dispositivos para o estado S3 ou S4?

Responder1

Tive um problema semelhante recentemente, quando de repente a suspensão parou de funcionar devido ao USB. Eu escrevi este script para consertar:

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

Coloque o script /lib/systemd/system-sleep/custom-xhci_hcde marque-o como executável com:

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

Na próxima reinicialização, o script é ativado.


Suspender registro de mensagens

Use journalctl -xee pressione Page Upvárias vezes para ver as mensagens suspensas:

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

Em seguida, pressione Page Downvárias vezes para ver as mensagens de currículo:

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.

informação relacionada