RedditPP Mascot

RedditPP

r/archlinux • … • u/Lunch

systemctl hybrid-sleep broken in linux-4.19.x

Starting with 4.19.x I've been unable to use `systemctl hybrid-sleep`. Calling `systemctl hybrid-sleep` results in my machine starting to hibernate but never fully powering down. I'm forced to hold the power button to turn off the machine. When the machine boots up again it's in the exact state I left it. This makes sense as `systemctl hibernate` still works fine for some reason.

To be sure that this was indeed a problem with 4.19 I went back and tested the LTS kernel and 4.18.16. Both worked fine. The problem started with 4.19.1 and persists in 4.19.4. I haven't been able to test 4.19.5 from testing yet because it won't install (`mkinicpio` fails) but I suspect it'll have the same issue.

Here's what I see in my logs right after `systemctl hybrid-sleep`:

Nov 29 23:14:59 mymachine systemd[1]: Reached target Sleep. Nov 29 23:14:59 mymachine systemd[1]: Starting Hibernate... Nov 29 23:14:59 mymachine systemd-sleep[5597]: Suspending system... Nov 29 23:14:59 mymachine kernel: PM: Image not found (code -22) Nov 29 23:14:59 mymachine kernel: PM: hibernation entry

Some digging into the kernel source shows that the `Image not found` message is coming [from here](https://github.com/torvalds/linux/blob/747f62305dfb8a592835c7401069bfdbc06acbae/kernel/power/swap.c#L1547). Error code 22 is `EINVAL` so that means the `memcmp` call [here](https://github.com/torvalds/linux/blob/747f62305dfb8a592835c7401069bfdbc06acbae/kernel/power/swap.c#L1527) returned `0`... and that's where I'm lost.

Anyone else running into this?

**edit**: Still an issue in 4.19.6.

— 0