[SOLVED] Using Linux QEMU/KVM causes s2idle hard freeze on Arch - Linux 6.10.8

Which Linux distro are you using?

Arch

Which release version?
7th September

Which kernel are you using?
6.10.8

Which BIOS version are you using?
03.05

Which Framework Laptop 13 model are you using? (AMD Ryzen™)

I’ve been trying to track this down… A s2idle suspend hard freezes my system when using QEMU with KVM acceleration.

Easy to repro… start qemu-system-x86_64 --accel kvm and try to suspend… Hard freeze… 10 second salute.

Nothing exotic… No extra kernel params.

How do you reproduce?

❯ uname -r
6.10.8-2-cachyos
❯ qemu-system-x86_64 --accel kvm

And then in another tab I ran a suspend sequence test and hit no problem.

❯ sudo ~/src/amd/scripts/amd_s2idle.py
Location of log file (default s2idle_report-2024-09-06.txt)? 
Debugging script for s2idle on AMD systems
💻 Framework Laptop 13 (AMD Ryzen 7040Series) (Laptop) running BIOS 3.5 (03.05) released 03/29/2024 and EC unknown
🐧 CachyOS
🐧 Kernel 6.10.8-2-cachyos
🔋 Battery BAT1 (NVT Framewo) is operating at 100.17% of design
Checking prerequisites for s2idle
✅ Logs are provided via systemd
✅ AMD Ryzen 5 7640U w/ Radeon 760M Graphics (family 19 model 74)
✅ SMT enabled
✅ LPS0 _DSM enabled
✅ ACPI FADT supports Low-power S0 idle
✅ HSMP driver `amd_hsmp` not detected (blocked: False)
✅ PMC driver `amd_pmc` loaded (Program 0 Firmware 76.82.0)
✅ USB4 driver `thunderbolt` bound to 0000:c3:00.5
✅ USB4 driver `thunderbolt` bound to 0000:c3:00.6
✅ GPU driver `amdgpu` bound to 0000:c1:00.0
✅ System is configured for s2idle
✅ NVME Sandisk Corp WD Black SN770 / PC SN740 256GB / PC SN560 (DRAM-less) NVMe SSD is configured for s2idle in BIOS
✅ GPIO driver `pinctrl_amd` available
How long should suspend cycles last in seconds (default 10)? 
How long to wait in between suspend cycles in seconds (default 4)? 
How many suspend cycles to run (default 1)? 
Started at 2024-09-06 23:36:00.277079 (cycle finish expected @ 2024-09-06 23:36:14.277092)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe0B increased from 146 to 160
✅ Userspace suspended for 0:00:12.503340
✅ In a hardware sleep state for 0:00:08.396301 (67.15%)
🔋 Battery BAT1 (NVT Framewo) is operating at 100.17% of design

You’ve got no guests running? I’m guessing maybe there might be more to reproductio in steps

Curious, it’s not reproducible with that tool, but does happen with systemctl suspend

Here’s the tool output anyway.

Aha!

Some systemd change… this is the fix [SOLVED] System freezes after sleep since update / Newbie Corner / Arch Linux Forums
Not sure what side-effect this has on battery life.

Not hardware related at all, sorry!

3 Likes
1 Like

I think this really boils down to systemd exposed a kernel bug. There will be tension for a while until the kernel is fixed or systemd withdraws this change.

1 Like

Do you think the workaround has any adverse effects?

FYI also needed

[Service]
Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"

in

/etc/systemd/system/systemd-hibernate.service.d/disable_freeze_user_session.conf

or hibernate has the same behavior.

1 Like

and


cp -rv /etc/systemd/system/systemd-suspend.service.d/ /etc/systemd/system/systemd-suspend-then-hibernate.service.d/

Annoying whackamole

On the systemd bug they say it should be fixed in 6.11. Can you upgrade to 6.11-rc7 and confirm?

Should get time later today UTC+1

6.11.0-rc7 still has the problem(without the workaround)

Can you share to the systemd ticket? They seem to think it would be fixed.

1 Like