Article 5GEB0 Unable to configure suspend-then-hibernate on new installation of -current

Unable to configure suspend-then-hibernate on new installation of -current

by
uiopqwerty
from LinuxQuestions.org on (#5GEB0)
Hi all,

I have recently installed -current from a Liveslack image on my laptop (MacBook Pro 12,1). It is working great and I have sorted out most of the small issues (mostly to do with resuming from sleep - WiFi driver sometimes failing after resuming from sleep, out-of-tree module for FaceTimeHD webcam causing the kernel to crash after resuming from sleep). However, I cannot get suspend-then-hibernate working. I am interested in getting this working mainly because I often close my laptop and leave it for days - if it runs out of power while sleeping, the system clock loses power and resets; I have no idea how much of a pain this would be under Linux versus under macOS ...

Does anyone have any advice for getting suspend-then-hibernate working? Thank you all and much appreciated in advance!

A few details about my system:
  • I have a full install of Slackware -current
  • I am using KDE Plasma 5
  • I have a handful of other Slackbuilds, mainly user programs - ufw, Spotify, etc.
  • I have an out-of-tree module installed for FaceTimeHD, but I do not load this module anywhere - I was loading it in rc.modules.local, but it was causing issues when suspending the system so I commented that line out. It is not currently loaded
  • In the System Settings under 'Power Management'>'Energy Saving'>{'On Battery','On Low Battery'}, I have the box "While asleep, hibernate after a period of inactivity" checked. I do not have the "Suspend session automatically after n minutes" box checked (or the type of suspend menu selected), but I have tested with this box checked as well and no luck
  • I can confirm that hibernate itself works - when I go straight into hibernate mode, I can boot my system again and get back to my session, but despite my attempts to change configuration I just cannot get suspend-then-hibernate to work. *edit*: I have just tried to use hibernate mode, and my system wakes up from hibernate immediately ... weird ...
Output from uname -a:
Code:Linux darkstar.example.net 5.10.22 #1 SMP Tue Mar 9 16:42:18 CST 2021 x86_64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz GenuineIntel GNU/LinuxContents of /etc/elogind/login.conf.d/login.conf (symlinked to a file in my home directory so I don't forget where it is). I copied these fields straight from /etc/elogind/login.conf and haven't uncommented any fields - I assume all the commented-out values are the defaults for elogind. (This is all so I can remind myself of what options are available):
Code:[Login]
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192Contents of /etc/elogind/sleep.conf/d/sleep.conf (also symlinked to a file under my home directory). I have uncommented the fields `AllowSuspendThenHibernate' and `HibernateDelaySec'. The HibernateDelaySec is only 30 seconds because I want to test this feature, I will make it something like 30 minutes eventually:
Code:[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#AllowPowerOffInterrupts=no
#BroadcastPowerOffInterrupts=yes
#AllowSuspendInterrupts=no
#BroadcastSuspendInterrupts=yes
#HandleNvidiaSleep=no
#SuspendState=mem standby freeze
#SuspendMode=
#HibernateState=disk
#HibernateMode=platform shutdown
#HybridSleepState=disk
#HybridSleepMode=suspend platform shutdown
HibernateDelaySec=30Contents of /proc/acpi/wakeup:
Code:Device S-state Status Sysfs node
PEG0 S3 *disabled
EC S4 *disabled platform:PNP0C09:00
HDEF S3 *disabled pci:0000:00:1b.0
RP01 S3 *enabled pci:0000:00:1c.0
RP02 S3 *enabled pci:0000:00:1c.1
RP03 S3 *enabled pci:0000:00:1c.2
ARPT S4 *enabled pci:0000:03:00.0
RP05 S3 *enabled pci:0000:00:1c.4
RP06 S3 *enabled pci:0000:00:1c.5
SPIT S3 *disabled spi:spi-APP000D:00
XHC1 S3 *disabled pci:0000:00:14.0
ADP1 S4 *disabled platform:ACPI0003:00
LID0 S4 *enabled platform:PNP0C0D:00Output from `loginctl show-session':
Code:EnableWallMessages=no
KillUserProcesses=no
RebootToFirmwareSetup=no
RebootToBootLoaderMenu=18446744073709551615
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
UserStopDelayUSec=0
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
LidClosed=no
OnExternalPower=yes
RemoveIPC=yes
RuntimeDirectorySize=1668739072
RuntimeDirectoryInodesMax=407407
InhibitorsMax=8192
NCurrentInhibitors=5
SessionsMax=8192
NCurrentSessions=1I don't think it's related, but I have the following udev script in /etc/udev/rules/90-xhc_sleep.rules (again symlinked) to prevent random USB events from waking the system (the system would suspend and immediately resume, and it came down to the XHC1 device). This suspend-then-hibernate issue was there before I deployed this script.
Code:SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"I am running LVM on LUKS, and the image section of my elilo.conf file currently looks like this:
Code:image=vmlinuz
label=vmlinuz
initrd=initrd.gz
root=/dev/cryptvg/root
append="resume=/dev/cryptvg/swap"
read-onlyI made an initrd using the following command. This was produced by mkinitrd_command_generator.sh, with the addition of the hid-apple module for the keyboard and the `-h' flag for specifying the swap partition for hibernation:
Code:mkinitrd -c -k 5.10.22 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci-hcd:uas:xhci-pci:ohci-pci:ehci-pci:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-apple:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:ext4 -C /dev/sda3 -L -h /dev/cryptvg/swap -u -o /boot/initrd.gzlatest?d=yIl2AUoC8zA latest?i=KMtb_j72Rcw:A0Kj_JEiD9g:F7zBnMy latest?i=KMtb_j72Rcw:A0Kj_JEiD9g:V_sGLiP latest?d=qj6IDK7rITs latest?i=KMtb_j72Rcw:A0Kj_JEiD9g:gIN9vFwKMtb_j72Rcw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments