It was solved by @Mario_Limonciello’s suggestion below, to set rtc_cmos.use_acpi_alarm=1 in the kernel settings. Not sure why, maybe they can explain, but I had it sleep for one hour, wake up, then hibernate last night perfectly.
Old text:
I just ran into this – If you’re using the AMD-specific wifi module (not AX210), and you happen to use suspend-then-hibernate (this makes it so your laptop after sleeping for e.g. 60 minutes, will hibernate instead, like a macbook does), there seems to be a bug that causes your computer to wake up after 5 minutes.
I am and have been using an mt7922 in my 11th gen for several months with suspend-then hibernate and the machine is operating properly. Currently running manjaro (yeah, I know. I am not motivated enough to set up and configure everything manually in order to run arch) with gnome, 6.6.0-1-Manjaro.
Well, I swapped out the mt7922 with AX210 and it still wakes up after 5 minutes, so maybe it’s something else. I’ll go through what’s in /proc/acpi/wakeup one by one and see if one of them is the issue.
Went through all the /proc/acpi/wakeup and disabled all of them, still wakes up after 5 minutes.
I’m beginning to suspect that the RTC wakeup alarm isn’t working properly (that’s what gets set during suspend-then-hibernate), and is being set to 5 minutes every time.
Digging into the systemd code and looking at the debug log (by adding Environment=SYSTEMD_LOG_LEVEL=debug to /lib/systemd/system/systemd-suspend-then-hibernate.service , it appears it uses timerfd_create with CLOCK_BOOTTIME_ALARM, which does appear to be set to the correct value (1 hour, in my case), so something else is setting some type of alarm after 5 minutes, but regular suspend doesn’t cause this alarm for some reason.
I typically have the machine sleep from being idle, or by closing the lid. I did set the automatic suspend parameters in the gnome gui to 30 and 45 minutes on battery and power, respectively, as it seemed to be conflicting with what I have set in logind.conf
@Mario_Limonciello Is there some type of explanation for what this kernel param does, or how you found that this helps? (or a bug report somewhere?)
Or some type of indication what the bug may be (in hardware?), or perhaps why this doesn’t affect everyone, since this is the first I’m hearing of it, not related to the wifi card.
I’ve posted a patch for it to the mailing lists. It does the same thing as the module parameter. If that’s accepted, you can drop it when upgrading to a kernel that includes it.
We’re wanting to test [kernel-6.5.12-300.fc39](https://bodhi.fedoraproject.org/updates/FEDORA-2023-03b11e7dcf) so merely updating should get you there.