Trying Suspend-to-Idle

Background

OpenBSD has long supported suspend via apm(8), using S3. This mode of CPU suspend has slowly been replaced by other methods - "modern standby (S0)". The goal appears to be acting like phones that transition between these states instantly:

When you wake up your phone, it is instantly ready to go. Your email, messages, and notifications are up to date because, even with your phone asleep, it is still connected and updating itself, all without a big hit to the battery life. Modern Standby is Microsoft's effort to bring similar instant-on readiness to Windows.

(Source)

As a consequence, many laptops in recent years don't support S3 at all. This applies to several of my laptops, including the Dell Precision and the Framework 16.

When I tried to use zzz(8), OpenBSD would simply tell me that S3 is not supported... until now!

Thanks to kettenis@'s work, we now have an alternate option, at least on (some) amd64 machines to suspend that works with laptops like mine that lack S3 support:

Commit of suspend-to-idle

Testing the New Suspend

After updating my system's snapshot, I booted and then just tried

from X11 ... and voila, the screen went bla[cn]k and after a few seconds, the key backlight turned off. The light of the power button remained on (no blinking or other change to indicate any kind of suspend/sleep state).

So the first half of this worked as expected! Now I tried to resume... I first hit the space bar - the key backlight turned on, but nothing else happened. I tried a few other keys - it seems that regular key presses don't wake up the laptop. This is fine with me, as long as other buttons can bring it back up!

So I tried pressing the power button ... once, twice... No change. I started to worry a bit that this computer wasn't ready for this. After nothing woke up the screen/laptop, I pressed the power button for a few seconds...

... and there it was - the X11 windows was back up, where I had entered zzz(8)!

Conclusion

It seems that I need to hold the power button for a few seconds on this laptop to resume - this is a little unintuitive, as I was expecting this to trigger a cold shutdown. I suspect holding the button even longer will do that indeed.

But now that I know this, this is a huge improvement for my OpenBSD laptop use! I've come to work around lack of suspend for years now, with seeking out power plugs and just shutting down or sometimes hibernating the system when I have work to resume. I've missed a quick and reliable suspend/sleep mode and it looks like it's finally back!

dmesg