My system was sleeping and resuming just fine, but for a few months, the system wakes itself after going to sleep.
I looked with dmidecode
at the 'Wake-up Type' and it says PCI PME#
. Then I searched a bit for similar problems and most of them point at /proc/acpi/wakeup
, which lists all devices that can wake the system. I disabled all of them, but still the system wakes itself.
I also tried lots of other things, like adding kernel parameters for acpi_os
and various BIOS options (disabling Fast Boot, enabling/disabling ErP, Native ASPM, on-board devices).
Of course, the logs are important to get more clues. This is what it looks like:
Oct 17 10:13:39 archlinux systemd[1]: nvidia-suspend.service: Deactivated successfully.
Oct 17 10:13:39 archlinux systemd[1]: Finished NVIDIA system suspend actions.
Oct 17 10:13:39 archlinux systemd[1]: nvidia-suspend.service: Consumed 613ms CPU time, 828.2M memory peak.
Oct 17 10:13:39 archlinux systemd[1]: Starting System Suspend...
Oct 17 10:13:39 archlinux systemd-sleep[2157]: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
Oct 17 10:13:39 archlinux systemd-sleep[2157]: This is not recommended, and might result in unexpected behavior, particularly
Oct 17 10:13:39 archlinux systemd-sleep[2157]: in suspend-then-hibernate operations or setups with encrypted home directories.
Oct 17 10:13:39 archlinux systemd-sleep[2157]: Performing sleep operation 'suspend'...
Oct 17 10:13:39 archlinux kernel: PM: suspend entry (deep)
Oct 17 10:13:39 archlinux systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Oct 17 10:13:39 archlinux kernel: Filesystems sync: 0.140 seconds
Oct 17 10:16:19 archlinux kernel: Freezing user space processes
Oct 17 10:16:19 archlinux kernel: Freezing user space processes completed (elapsed 0.001 seconds)
Oct 17 10:16:19 archlinux kernel: OOM killer disabled.
Oct 17 10:16:19 archlinux kernel: Freezing remaining freezable tasks
Oct 17 10:16:19 archlinux kernel: Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
Oct 17 10:16:19 archlinux kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Oct 17 10:16:19 archlinux kernel: ACPI: EC: interrupt blocked
Oct 17 10:16:19 archlinux kernel: ACPI: PM: Preparing to enter system sleep state S3
Oct 17 10:16:19 archlinux kernel: ACPI: EC: event blocked
Oct 17 10:16:19 archlinux kernel: ACPI: EC: EC stopped
Oct 17 10:16:19 archlinux kernel: ACPI: PM: Saving platform NVS memory
Oct 17 10:16:19 archlinux kernel: Disabling non-boot CPUs ...
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 15 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 14 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 13 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 12 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 11 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 10 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 9 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 8 is now offline
Oct 17 10:16:19 archlinux kernel: Spectre V2 : Update user space SMT mitigation: STIBP off
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 7 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 6 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 5 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 4 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 3 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 2 is now offline
Oct 17 10:16:19 archlinux kernel: smpboot: CPU 1 is now offline
Oct 17 10:16:19 archlinux kernel: ACPI: PM: Low-level resume complete
Oct 17 10:16:19 archlinux kernel: ACPI: EC: EC started
Oct 17 10:16:19 archlinux kernel: ACPI: PM: Restoring platform NVS memory
Oct 17 10:16:19 archlinux kernel: AMD-Vi: Virtual APIC enabled
Oct 17 10:16:19 archlinux kernel: AMD-Vi: Virtual APIC enabled
You can see the system successfully enters suspend at 'PM: suspend entry (deep)' and indeed the screen goes black, fans stop spinning etc. But after about three minutes, everything comes alive again. The first entry in the log is 'Freezing user space processes' and then there are a few interesting entries:
Oct 17 10:16:19 archlinux kernel: ACPI: EC: interrupt blocked
Oct 17 10:16:19 archlinux kernel: ACPI: PM: Preparing to enter system sleep state S3
Oct 17 10:16:19 archlinux kernel: ACPI: EC: event blocked
Oct 17 10:16:19 archlinux kernel: ACPI: EC: EC stopped
If I read this correctly, the system tries to enter state S3, but fails ('event blocked'), upon which a resume is initiated. And then I can hear the fans spinning up again (though the screen stays black).
So what event was blocked and why? I think it has something to do with the BIOS, since I updated that a few months ago, and again last week (though no change). It's an ASUS B650E-I motherboard (with Ryzen 9700X CPU, 2 Intel Optane P5800X NVMe drives and NVIDIA RTX 4070 Super GPU) and I found out there are similar issues with Gigabyte B650 motherboards. But the solution for the Gigabyte boards (adding acpi_os
kernel parameter) doesn't work for me.
Some more info that could be useful (or before anyone asks): I'm using Arch Linux, fully updated to the latest version, with KDE Plasma (newest). And I've had all USB devices unplugged, so it's definitely not one of those. As far as 'PCI PME#' is concerned, I think that only leaves the PCIe lanes/bridges, so that means CPU, motherboard, NVMe or GPU.