Suspend and hibernate work correctly, but suspend-then-hibernate hangs for 5 minutes

Hi all,

Since mid-January, I've begun to have issues with my suspend-then-hibernate functionality. I was hoping that the latest systemd update might resolve my issue, but no luck.

On my system, suspending (i.e. systemctl suspend) and hibernating (i.e. systemctl hibernate) both work completely as expected. With suspend, my system instantly suspends. I'm able to suspend to either s2idle or deep depending on my choice of configuration. With hibernate, my system displays the lock screen for a few seconds before hibernating and powering off.

However, suspend-then-hibernate (i.e. systemctl suspend-then-hibernate) does not work correctly. When I use suspend-then-hibernate, my system displays a black screen with a visible cursor for about a minute before suspending. When resuming-- from both suspend or hibernate states via suspend-then-hibernate-- my system displays the black screen with visible cursor for 3-5 minutes before displaying the lock screen. The visible cursor responds to mouse input during this, but I am unable to switch to a virtual terminal.

My current sleep.conf is as below. The file is unchanged from December, when suspend-then-hibernate worked correctly.

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the sleep.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See systemd-sleep.conf(5) for details.

[Sleep]
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
AllowHybridSleep=no
#SuspendMode=
#SuspendState=mem standby freeze
HibernateMode=platform shutdown
HibernateState=disk
#HybridSleepMode=suspend platform shutdown
HybridSleepState=disk
HibernateDelaySec=2700sec
#HibernateDelaySec=90sec

And my garuda-inxi is as follows. I have additionally tested this using the linux and linux-lts kernels, in case the issue was somehow related to linux-zen.

System:
Kernel: 6.2.8-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=79593c2e-62f0-445f-9116-964cb89e34c7 rw rootflags=subvol=@
quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
systemd.unified_cgroup_hierarchy=1
resume=UUID=84ac06b1-8de9-4d06-ab37-23866ae6d543 loglevel=3
mem_sleep_default=deep nvme.noacpi=1 i915.enable_psr=1
Desktop: KDE Plasma v: 5.27.3 tk: Qt v: 5.15.8 info: latte-dock
wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: Framework product: Laptop v: AA
serial: <superuser required>
Mobo: Framework model: FRANBMCP0A v: AA serial: <superuser required>
UEFI: INSYDE v: 03.10 date: 07/19/2022
Battery:
ID-1: BAT1 charge: 39.8 Wh (79.4%) condition: 50.1/55.0 Wh (91.0%)
volts: 16.1 min: 15.4 model: NVT Framewo type: Li-ion serial: <filter>
status: discharging cycles: 109
CPU:
Info: model: 11th Gen Intel Core i5-1135G7 bits: 64 type: MT MCP
arch: Tiger Lake gen: core 11 level: v4 note: check built: 2020
process: Intel 10nm family: 6 model-id: 0x8C (140) stepping: 1
microcode: 0xA6
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 320 KiB desc: d-4x48 KiB; i-4x32 KiB L2: 5 MiB desc: 4x1.2 MiB L3: 8 MiB
desc: 1x8 MiB
Speed (MHz): avg: 2018 high: 2400 min/max: 400/4200 scaling:
driver: intel_pstate governor: powersave cores: 1: 2400 2: 2400 3: 1137
4: 607 5: 2400 6: 2400 7: 2400 8: 2400 bogomips: 38707
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
arch: Gen-12.1 process: Intel 10nm built: 2020-21 ports: active: eDP-1
empty: DP-1, DP-2, DP-3, DP-4 bus-ID: 00:02.0 chip-ID: 8086:9a49
class-ID: 0300
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.1
compositor: kwin_x11 driver: X: loaded: modesetting
alternate: fbdev,intel,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 2256x1504 s-dpi: 96 s-size: 596x397mm (23.46x15.63")
s-diag: 716mm (28.19")
Monitor-1: eDP-1 model: BOE Display 0x095f built: 2019 res: 2256x1504
hz: 60 dpi: 201 gamma: 1.2 size: 285x190mm (11.22x7.48") diag: 343mm (13.5")
ratio: 3:2 modes: 2256x1504
API: OpenGL v: 4.6 Mesa 23.0.1 renderer: Mesa Intel Xe Graphics (TGL GT2)
direct-render: Yes
Audio:
Device-1: Intel Tiger Lake-LP Smart Sound Audio driver: snd_hda_intel
v: kernel alternate: snd_sof_pci_intel_tgl bus-ID: 00:1f.3
chip-ID: 8086:a0c8 class-ID: 0403
Sound API: ALSA v: k6.2.8-zen1-1-zen running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.67 running: yes
Network:
Device-1: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: aa:00.0 chip-ID: 8086:2725
class-ID: 0280
IF: wlp170s0 state: up mac: <filter>
IF-ID-1: tailscale0 state: unknown speed: -1 duplex: full mac: N/A
Bluetooth:
Device-1: Intel AX210 Bluetooth type: USB driver: btusb v: 0.8
bus-ID: 2-10:4 chip-ID: 8087:0032 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 2 state: down
bt-service: enabled,running rfk-block: hardware: no software: yes
address: <filter>
Drives:
Local Storage: total: 465.76 GiB used: 210.57 GiB (45.2%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
model: WDBRPG5000ANC-WRSN size: 465.76 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
rev: 111130WD temp: 44.9 C scheme: GPT
Partition:
ID-1: / raw-size: 398.98 GiB size: 398.98 GiB (100.00%)
used: 210.54 GiB (52.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 34.7 MiB (11.6%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 398.98 GiB size: 398.98 GiB (100.00%)
used: 210.54 GiB (52.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 398.98 GiB size: 398.98 GiB (100.00%)
used: 210.54 GiB (52.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 398.98 GiB size: 398.98 GiB (100.00%)
used: 210.54 GiB (52.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 31.14 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
ID-2: swap-2 type: partition size: 32.23 GiB used: 0 KiB (0.0%)
priority: 5 dev: /dev/nvme0n1p4 maj-min: 259:4
Sensors:
System Temperatures: cpu: 50.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info:
Processes: 358 Uptime: 44m wakeups: 58992 Memory: 31.14 GiB
used: 6.91 GiB (22.2%) Init: systemd v: 253 default: graphical
tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
pkgs: 2137 libs: 553 tools: octopi,paru,yay Shell: Bash v: 5.1.16
running-in: konsole inxi: 3.3.25
Garuda (2.6.16-1):
System install date:     2022-01-09
Last full system update: 2023-03-30 ↻
Is partially upgraded:   No
Relevant software:       snapper tlp NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:            root-resume.service

Hi there, welcome to the forum.
I don’t use suspend-then-hibernate, but I remember reading something interesting about it in the forum.
Give a look at this post, and thread in general:

2 Likes

Thanks for the suggestion! Based on that thread I need to have a value specified for SuspendMode and SuspendState, as those are explicitly used by suspend-then-hibernate. I went ahead and uncommented SuspendState=mem standby freeze and set SuspendMode=suspend.

Unfortunately this doesn't appear to change anything.


[Sleep]
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
AllowHybridSleep=no
SuspendMode=suspend
SuspendState=mem standby freeze
HibernateMode=platform shutdown
HibernateState=disk
#HybridSleepMode=suspend platform shutdown
HybridSleepState=disk
HibernateDelaySec=2700sec
#HibernateDelaySec=90sec

Just a few shots in the dark (sorry... :slight_smile: ):

  • I'd try removing the i915.enable_psr=1 (and maybe nvme.noacpi=1, but this shouldn't be a disk-related problem) kernel parameters (or there might be others to be added, but it's a jungle)
  • I'd try different kernels, e.g. at least the linux-lts to go "back" and linux-mainline or linux-next to go "forth" (although I agree it looks like a systemd issue, but you never can say)
2 Likes

Not bad ideas for sure, but I'm also increasingly confident that this is a systemd issue of some sort. For the sake of completeness, I tested with

  • linux
  • linux-zen
  • linux-lts
  • linux-next

all with my power saving kernel params i915.enable_psr=1 and nvme.noacpi=1 removed.

I tried a few other things, disabling services and trying to spot anything significantly different between suspend and suspend-then-hibernate in my journalctl.

I guess my logic is that there's got to be a difference between suspend and suspend-then-hibernate. As far as I understand, suspend-then-hibernate should literally work the same way as suspend with the addition of an RTC alarm to check when to hibernate (source). Since my suspend and hibernate both work normally, that leads me to believe the issue is somehow with the RTC alarm component.

The rest of this post is kind of a data dump because I don't think I understand enough to really debug it myself. Here are a couple journalctl segments with large time jumps in them during the suspend-then-hibernate & resume processes.

In particular, we lose almost a whole minute during suspend on whatever's happening here:

Mar 31 13:29:08 aeolus systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Mar 31 13:29:56 aeolus kernel: cros-ec-dev cros-ec-dev.4.auto: Some logs may have been dropped...

On resume, the notable gaps are

Mar 31 13:30:48 aeolus kernel: hid-sensor-hub 001F:8087:0AC2.0001: timeout waiting for response from ISHTP device
Mar 31 13:31:18 aeolus systemd[1]: Starting Cleanup of Temporary Directories...

and the long one

Mar 31 13:31:18 aeolus systemd[1]: run-credentials-systemd\x2dtmpfiles\x2dclean.service.mount: Deactivated successfully.
Mar 31 13:32:15 aeolus systemd[1]: systemd-suspend-then-hibernate.service: Deactivated successfully.

I can eliminate the hid-sensor-hub timeout message by blacklisting the module, but that doesn't change the result.

Full journalctl from the point where suspend-then-hibernate starts to the point where it exits, covering both suspend and resume here:

Mar 31 13:28:59 aeolus systemd[1]: Reached target Sleep.
Mar 31 13:28:59 aeolus systemd[1]: Starting Suspend; Hibernate if not used for a period of time...
Mar 31 13:28:59 aeolus dbus-daemon[751]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.>
Mar 31 13:28:59 aeolus dbus-daemon[751]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not>
Mar 31 13:28:59 aeolus runuser[100768]: pam_systemd_home(runuser-l:session): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Mar 31 13:28:59 aeolus runuser[100768]: pam_unix(runuser-l:session): session opened for user dhruv(uid=1000) by (uid=0)
Mar 31 13:28:59 aeolus systemd[1]: Started Session 8 of User dhruv.
Mar 31 13:29:08 aeolus systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Mar 31 13:29:56 aeolus kernel: cros-ec-dev cros-ec-dev.4.auto: Some logs may have been dropped...
Mar 31 13:30:07 aeolus prelockd[766]: currently locked 247.5M, 666 files
Mar 31 13:30:29 aeolus systemd-sleep[100764]: Entering sleep state 'suspend'...
Mar 31 13:30:29 aeolus kernel: PM: suspend entry (deep)
Mar 31 13:30:29 aeolus kernel: Filesystems sync: 0.036 seconds
Mar 31 13:30:45 aeolus kernel: Freezing user space processes
Mar 31 13:30:45 aeolus kernel: Freezing user space processes completed (elapsed 0.001 seconds)
Mar 31 13:30:45 aeolus kernel: OOM killer disabled.
Mar 31 13:30:45 aeolus kernel: Freezing remaining freezable tasks
Mar 31 13:30:45 aeolus kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
Mar 31 13:30:45 aeolus kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Mar 31 13:30:45 aeolus kernel: ACPI: EC: interrupt blocked
Mar 31 13:30:45 aeolus kernel: ACPI: PM: Preparing to enter system sleep state S3
Mar 31 13:30:45 aeolus kernel: ACPI: EC: event blocked
Mar 31 13:30:45 aeolus kernel: ACPI: EC: EC stopped
Mar 31 13:30:45 aeolus kernel: ACPI: PM: Saving platform NVS memory
Mar 31 13:30:45 aeolus kernel: Disabling non-boot CPUs ...
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 1 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 2 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 3 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 4 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 5 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 6 is now offline
Mar 31 13:30:45 aeolus kernel: smpboot: CPU 7 is now offline
Mar 31 13:30:45 aeolus kernel: ACPI: PM: Low-level resume complete
Mar 31 13:30:45 aeolus kernel: ACPI: EC: EC started
Mar 31 13:30:45 aeolus kernel: ACPI: PM: Restoring platform NVS memory
Mar 31 13:30:45 aeolus kernel: Enabling non-boot CPUs ...
Mar 31 13:30:45 aeolus kernel: x86: Booting SMP configuration:
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
Mar 31 13:30:45 aeolus kernel: CPU1 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 2 APIC 0x4
Mar 31 13:30:45 aeolus kernel: CPU2 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 3 APIC 0x6
Mar 31 13:30:45 aeolus kernel: CPU3 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 4 APIC 0x1
Mar 31 13:30:45 aeolus kernel: CPU4 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 5 APIC 0x3
Mar 31 13:30:45 aeolus kernel: CPU5 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 6 APIC 0x5
Mar 31 13:30:45 aeolus kernel: CPU6 is up
Mar 31 13:30:45 aeolus kernel: smpboot: Booting Node 0 Processor 7 APIC 0x7
Mar 31 13:30:45 aeolus kernel: CPU7 is up
Mar 31 13:30:45 aeolus kernel: ACPI: PM: Waking up from system sleep state S3
Mar 31 13:30:45 aeolus kernel: ACPI: EC: interrupt unblocked
Mar 31 13:30:45 aeolus kernel: ACPI: EC: event unblocked
Mar 31 13:30:45 aeolus kernel: nvme nvme0: 8/0/0 default/read/poll queues
Mar 31 13:30:45 aeolus kernel: nvme nvme0: resetting controller due to AER
Mar 31 13:30:45 aeolus kernel: nvme nvme0: Identify namespace failed (-4)
Mar 31 13:30:45 aeolus kernel: nvme nvme0: 8/0/0 default/read/poll queues
Mar 31 13:30:45 aeolus kernel: iwlwifi 0000:aa:00.0: WFPM_UMAC_PD_NOTIFICATION: 0x1f
Mar 31 13:30:45 aeolus kernel: iwlwifi 0000:aa:00.0: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
Mar 31 13:30:45 aeolus kernel: iwlwifi 0000:aa:00.0: WFPM_AUTH_KEY_0: 0x80
Mar 31 13:30:45 aeolus kernel: iwlwifi 0000:aa:00.0: CNVI_SCU_SEQ_DATA_DW9: 0x0
Mar 31 13:30:45 aeolus kernel: OOM killer enabled.
Mar 31 13:30:45 aeolus kernel: Restarting tasks ...
Mar 31 13:30:45 aeolus kernel: usb 2-9: USB disconnect, device number 5
Mar 31 13:30:45 aeolus systemd-logind[767]: Power key pressed short.
Mar 31 13:30:45 aeolus kernel: done.
Mar 31 13:30:45 aeolus kernel: random: crng reseeded on system resumption
Mar 31 13:30:45 aeolus systemd-sleep[100764]: System returned from sleep state.
Mar 31 13:30:45 aeolus kernel: PM: suspend exit
Mar 31 13:30:45 aeolus dbus-daemon[751]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.>
Mar 31 13:30:45 aeolus dbus-daemon[751]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not>
Mar 31 13:30:45 aeolus runuser[109963]: pam_systemd_home(runuser-l:session): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Mar 31 13:30:45 aeolus runuser[109963]: pam_unix(runuser-l:session): session opened for user dhruv(uid=1000) by (uid=0)
Mar 31 13:30:45 aeolus systemd[1]: Started Session 9 of User dhruv.
Mar 31 13:30:45 aeolus kernel: usb 2-9: new full-speed USB device number 6 using xhci_hcd
Mar 31 13:30:45 aeolus kernel: ish-hid {33AECD58-B679-4E54-9BD9-A04D34F0C226}: [hid-ish]: enum_devices_done OK, num_hid_devices=1
Mar 31 13:30:45 aeolus kernel: usb 2-9: New USB device found, idVendor=27c6, idProduct=609c, bcdDevice= 1.00
Mar 31 13:30:45 aeolus kernel: usb 2-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 31 13:30:45 aeolus kernel: usb 2-9: Product: Goodix USB2.0 MISC
Mar 31 13:30:45 aeolus kernel: usb 2-9: Manufacturer: Goodix Technology Co., Ltd.
Mar 31 13:30:45 aeolus kernel: usb 2-9: SerialNumber: UIDC3E26AAF_XXXX_MOC_B0
Mar 31 13:30:46 aeolus mtp-probe[111226]: checking bus 2, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-9"
Mar 31 13:30:46 aeolus mtp-probe[111226]: bus: 2, device: 6 was not an MTP device
Mar 31 13:30:46 aeolus mtp-probe[112283]: checking bus 2, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-9"
Mar 31 13:30:46 aeolus mtp-probe[112283]: bus: 2, device: 6 was not an MTP device
Mar 31 13:30:48 aeolus kernel: hid-sensor-hub 001F:8087:0AC2.0001: timeout waiting for response from ISHTP device
Mar 31 13:31:18 aeolus systemd[1]: Starting Cleanup of Temporary Directories...
Mar 31 13:31:18 aeolus systemd[1]: systemd-tmpfiles-clean.service: Deactivated successfully.
Mar 31 13:31:18 aeolus systemd[1]: Finished Cleanup of Temporary Directories.
Mar 31 13:31:18 aeolus systemd[1]: run-credentials-systemd\x2dtmpfiles\x2dclean.service.mount: Deactivated successfully.
Mar 31 13:32:15 aeolus systemd[1]: systemd-suspend-then-hibernate.service: Deactivated successfully.
Mar 31 13:32:15 aeolus latte-dock[59503]: [59497:59529:0331/133215.779668:ERROR:connection_factory_impl.cc(428)] Failed to connect to MCS endpoint with error -7
Mar 31 13:32:15 aeolus systemd[1]: Finished Suspend; Hibernate if not used for a period of time.
Mar 31 13:32:15 aeolus systemd[1]: Stopped target Sleep.
Mar 31 13:32:15 aeolus systemd[1]: Reached target Suspend; Hibernate if not used for a period of time.
Mar 31 13:32:15 aeolus systemd[1]: Stopped target Suspend; Hibernate if not used for a period of time.

Funny enough, we did get a bit of speedup when I disabled the fw-fanctrl, tailscaled, and nmbd services to produce a cleaner journalctl log. Now I'm only on the black screen for a couple minutes on resume.

You gathered a lot of information and knowledge.
I think you could try entering an issue upstream:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.