=== Suspend/Resume Improvement

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://reviews.freebsd.org/D48721[Tip of the s2idle/S0ix + AMD SMU stack] URL: https://reviews.freebsd.org/D48721[]

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.

Entry to S0i3 is now working semi-reliably on the Framework 13 AMD Ryzen 7040 series laptops on FreeBSD 15.

The sleep type and sysctl code has been committed, and a fix for a regression that introduced made (link:https://reviews.freebsd.org/D53909[D53909]).
Because of some existing issues in our ACPI D-state code causing some devices which were previously working to fail entering S3, related commits for D-state changes necessary for S0ix had to be rolled back, though these do not seem to affect S0i3 entry on the aforementioned machine.
Work has been made on cleaning up and fixing our D-state code, but this is not a huge priority so long as it does not prevent S0i3 entry on the targeted machine(s).

The s2idle and SPMC revisions (link:https://reviews.freebsd.org/D48734[D48734] and link:https://reviews.freebsd.org/D48387[D48387] respectively) have been reviewed and have had some work done on them to prepare them for being committed.
New exploratory revisions have been made to implement the s2idle loop (link:https://reviews.freebsd.org/D54406[D54406] and link:https://reviews.freebsd.org/D54410[D54410]) and some necessary scheduler changes (link:https://reviews.freebsd.org/D54407[D54407] and link:https://reviews.freebsd.org/D54409[D54409]).

Some issues have cropped up when resuming from S0i3, seemingly only when loading the USB4 driver, which have been looked into.

A pre-built sleep testing image is available to easily test S0i3 entry on machines.
Detailed instructions are on the link:https://obiw.ac/s0ix/[webpage].

With respect to the links, the blog post entry is still outdated.

Sponsor: The FreeBSD Foundation
