I set SuspendState=freeze
in /etc/systemd/sleep.conf. Since then the system will not wake up unless I close and open the laptop lid.
I cross referenced the input devices listed by
cat /proc/bus/input/devices
with the output of
sudo find /sys/ -iname wakeup -type f | less
to determine the wakeup files for the lid switch, sleep button, keyboard, and power button, and determine whether wakeup was enabled or disabled for them:
$ echo Lid Switch: `cat /sys/devices/platform/PNP0C0D:00/power/wakeup`
Lid Switch: disabled
$ echo Sleep Button: `cat /sys/devices/platform/PNP0C0E:00/power/wakeup`
Sleep Button: disabled
$ echo Keyboard: `cat /sys/devices/platform/i8042/serio0/power/wakeup`
Keyboard: enabled
$ echo Power Button: `cat /sys/devices/LNXSYSTM:00/LNXPWRBN:00/power/wakeup`
Power Button: enabled
Wake up devices:
$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
GLAN S4 *enabled pci:0000:00:1f.6
XHC S3 *enabled pci:0000:00:14.0
XDCI S4 *disabled
HDAS S4 *disabled pci:0000:00:1f.3
RP01 S4 *enabled pci:0000:00:1c.0
PXSX S4 *disabled pci:0000:02:00.0
RP02 S4 *disabled
PXSX S4 *disabled
PXSX S4 *disabled
RP04 S4 *disabled
PXSX S4 *disabled
RP05 S4 *disabled
PXSX S4 *disabled
RP06 S4 *disabled
PXSX S4 *disabled
RP07 S4 *enabled pci:0000:00:1c.6
PXSX S4 *disabled pci:0000:04:00.0
RP08 S4 *disabled
PXSX S4 *disabled
RP09 S4 *enabled pci:0000:00:1d.0
PXSX S4 *enabled pci:0000:07:00.0
RP10 S4 *disabled
PXSX S4 *disabled
RP11 S4 *enabled pci:0000:00:1d.2
PXSX S4 *disabled pci:0000:40:00.0
RP12 S4 *disabled
PXSX S4 *disabled
RP13 S4 *disabled
PXSX S4 *disabled
RP14 S4 *disabled
PXSX S4 *disabled
RP15 S4 *disabled
PXSX S4 *disabled
RP16 S4 *disabled
PXSX S4 *disabled
RP17 S4 *disabled
PXSX S4 *disabled
RP18 S4 *disabled
PXSX S4 *disabled
RP19 S4 *disabled
PXSX S4 *disabled
RP20 S4 *disabled
PXSX S4 *disabled
RP21 S4 *disabled
PXSX S4 *disabled
RP22 S4 *disabled
PXSX S4 *disabled
RP23 S4 *disabled
PXSX S4 *disabled
RP24 S4 *disabled
PXSX S4 *disabled
SLPB S3 *enabled platform:PNP0C0E:00
LID S4 *enabled platform:PNP0C0D:00
The power button is not in the list of wake up devices.
My system supports Suspend-to-Idle (denoted by freeze
):
$ cat /sys/power/state
freeze mem disk
$ cat /sys/power/mem_sleep
s2idle [deep]
/etc/systemd/sleep.conf
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=
#SuspendEstimationSec=60min
SuspendState=freeze
The kernel docs says this about Suspend-to-Idle:
The system is woken up from this state by in-band interrupts, so theoretically any devices that can cause interrupts to be generated in the working state can also be set up as wakeup devices for S2Idle.
I assume opening the laptop lid is an asynchronous interrupt as described in What is an interrupt?:
Asynchronous interrupts, usually named interrupts, are external events generated by I/O devices. For example a network card generates an interrupts to signal that a packet has arrived.
Does this mean the Linux software ecosystem does not support waking devices in the Suspend-to-Idle state by using hardware button wake up triggers?
The Arch Wiki says:
Wakeup triggers are event sources that can wake the system from any of the hardware power-saving states. The obvious example is the power or suspend button, the Wake-on-LAN functionality or the lid switch in laptop systems. Wakeup triggers can be controlled through various kernel interfaces listed below. There is no unified interface covering all possible triggers.
The bolded does not seem to be the case.
I enabled wakeups from the keyboard as described in Wakeup Trigger Interfaces. However, the keyboard still does not wakeup the system from the Suspend-to-Idle power state:
echo enabled | sudo tee /sys/devices/platform/i8042/serio0/power/wakeup
Wakeup Trigger Interfaces also claims:
/sys/class/wakeup/*
Almost all wakeup triggers can be found in the /sys/class/wakeup directory, which contains symlinks to all relevant devices. This is useful for finding possible wakeup triggers by going through subdirectories. Some of the triggers can correspond to virtual devices while hardware-related wakeup triggers are the ones that contain at least one of these files:
/sys/class/wakeup/*/device/physical_node/power/wakeup
/sys/class/wakeup/*/device/power/wakeup
However, on my system, there are no wakeup triggers in the /sys/class/wakeup/ directory. So in my case, wakeup triggers cannot be controlled from the /sys/class/wakeup/* kernel wakeup trigger interface.
When the power state was Suspend-to-RAM, the keyboard and power button could wake the system from suspend. The only problem with Suspend-to-RAM is that the system will not wake from sleep if rsync was running before suspending…
Pressing a keyboard key or the power button should wake laptop from Suspend-to-Idle.