=== Suspend/Resume Improvements

Links: +
link:https://obiw.ac/s0ix/[Blog] URL: link:https://obiw.ac/s0ix/[] +
link:https://youtu.be/RCjPc4X2Edc[BSDCan talk on s2idle/S0ix] URL: https://youtu.be/RCjPc4X2Edc[] +
link:https://people.freebsd.org/~obiwac/s0ix/[Sleep testing image] URL: https://people.freebsd.org/~obiwac/s0ix/[] +
link:https://github.com/obiwac/freebsd-s0ix/pull/15[Working branch] URL: link:https://github.com/obiwac/freebsd-s0ix/pull/15[]

Contact: obiwac <obiwac@FreeBSD.org>

Suspend-to-idle and support for S0ix sleep is in the process of being added to FreeBSD.

This will allow modern Intel and AMD laptops, some of which do not support ACPI S3 sleep, to enter low power states to increase battery life.

Most revisions have now been committed at this point, including the new acpi_spmc driver and s2idle support.
The only remaining things to land are USB4 suspend support and the s2idle loop (but that requires some more discussion and investigation).
See revisions link:https://reviews.freebsd.org/D52861[D52861] and link:https://reviews.freebsd.org/D54410[D54410] respectively.

Many bugs have been fixed, but there still is an issue where the system will sometimes lock up a few seconds after resuming.
This was narrowed down to the NVMe drive not waking correctly after being suspended -- still requires further investigation.

Work on an Intel PMC driver has started: link:https://reviews.freebsd.org/D54881[D54881]
This already allows for reading residency in the deepest possible S0ix state on Intel CPUs.

Work has started on a new generic power management interface: link:https://reviews.freebsd.org/D55508[D55508]
This is needed as s2idle is not an ACPI power state, and the only (modern) mechanism for power transition requests is the ACPI ioctl interface.
It has not yet landed because we might end up changing or even removing the distinction between sleep types and sleep state transitions.

Sponsor: The FreeBSD Foundation
