Cómo configurar el estado S3/S4 para dispositivos suspendidos

Cómo configurar el estado S3/S4 para dispositivos suspendidos

Tengo un transformador Dell Venue con LUbuntu 18.04 con el kernel 5.1.0-6.4-liquorix-amd64 #1 ZEN SMP PREEMPT liquorix 5.1-4ubuntu1~bionic (2019-06-03) x86_64 x86_64 x86_64 GNU/Linux. Deshabilité la activación de todos los dispositivos excepto PBTN. En BIOS, USB PowerShare está desactivado.

Sin embargo, después de colgar el portátil permanece caliente. Sólo tres dispositivos no cambian el estado de energía:

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

Las pruebas realizadas con juguetes LED USB no controlados muestran que permanecen encendidos durante la suspensión. Instalar herramientas en modo portátil no es útil (posiblemente, sean necesarias algunas configuraciones adicionales).

¿Cómo configurar los dispositivos al estado S3 o S4?

Respuesta1

Tuve un problema similar recientemente cuando, de repente, la suspensión dejó de funcionar debido al USB. Escribí este script para solucionarlo:

#!/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 el script /lib/systemd/system-sleep/custom-xhci_hcdy márquelo como ejecutable con:

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

En el próximo reinicio, se activa el script.


Suspender el registro de mensajes

Utilice journalctl -xey presione Page Upvarias veces para ver los mensajes de suspensión:

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

Luego presione Page Downvarias veces para ver los mensajes de currículum:

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.

información relacionada