After commit 7669cbd0f06402573fe627e9e6f86c69cfd3d12b (“acpi: Suspend-to-idle support (s2idle)”), the system can enter the S3 sleep state only once. Following the first resume, the system is no longer able to suspend again. Reverting this commit removes the limitation and allows unlimited suspend/resume cycles.
^Triage: fix typo in Cc: .
(In reply to Marek Zarychta from comment #0) Hello Marek, Could "acpi0: request to enter state NONE failed (err 22)" be related when closing/opening laptop? Cheers
(In reply to Nuno Teixeira from comment #2) I don’t know, this is most likely a different bug. This bug manifests itself in such a way that after the first wake-up, the acpiconf -s 3 or acpiconf -s S3 command hangs (it cannot be interrupted or killed), and the computer (in this case, a desktop PC) does not enter sleep mode. I can confirm that the situation you are describing occurs on a laptop with 16.0-CURRENT. FreeBSD 15.0-STABLE correctly handles suspend and resume via opening and closing the laptop lid. FreeBSD 16.0-CURRENT does not, and there the situation is exactly as you describe, but it is still possible to suspend the system using a command, and waking up from opening the lid works normally. Therefore, the situation you described is a different kind of regression, which was probably not reported before. Bisecting will be harder here because it is not known when it was exactly broken.
(In reply to Nuno Teixeira from comment #2) With regard to the issue you reported, it is sufficient to set, for example, via an entry in sysctl.conf, hw.acpi.lid_switch_state=s2mem, and everything returns to normal - suspending by closing the lid works again. It appears that this was changed in commit eeaa865edba68.
Created attachment 267294 [details] enter_s3without_limit.diff This trivial patch resolves the issue. Forgive me for making a storm in a teapot on the current@ mailing list.
Marek, can you send me the contents of the hw.acpi and kern.power sysctl trees? Just to be sure your machine is actually selecting s2mem/S3 (as it should) and its not accidentally trying to enter s2idle. I'm surprised your patch fixes the issue, because all unsetting the bits in slp_state only serves to make sure it is ACPI_SS_NONE after cleanup (see the MPASS).
Sorry scratch that, I just realized that ACPI_SS_SLP_PREP is being used after its being unset in the if statement surrounding the AcpiLeaveSleepState() call. I'm preparing a fix for this right now.
Can you try this patch out and see if it fixes S3 entry for you? https://reviews.freebsd.org/D54777
(In reply to Aymeric Wibo from comment #6) It's the same machine that was used on bug 289634 submission. Please reuse data from that PR if it's really required, and if the bug isn't reproducible (I believe it is).
(In reply to Aymeric Wibo from comment #8) This patch solves the problem as well. Thank you for giving opportunity to test it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=4b534b814aa03b44660ede6d5f1a62cb33c24115 commit 4b534b814aa03b44660ede6d5f1a62cb33c24115 Author: Aymeric Wibo <obiwac@FreeBSD.org> AuthorDate: 2026-01-19 13:19:52 +0000 Commit: Aymeric Wibo <obiwac@FreeBSD.org> CommitDate: 2026-01-19 16:30:10 +0000 acpi: Fix not calling AcpiLeaveSleepState() in S3 path When resuming from ACPI suspend, the ACPI_SS_SLP_PREP bit in slp_state was being checked and subsequently unset when calling resumeclock(). This bit was also being checked for the AcpiLeaveSleepState() call in the non-s2idle path, but having just been unset, it was never actually being called. Change this so that resumeclock() is always being called (since we never goto breakout between suspendclock() and resumeclock() anyway) and ACPI_SS_SLP_PREP is purely used for AcpiEnterSleepStatePrep() and AcpiLeaveSleepState() in the non-s2idle paths. PR: 292568 Reported by: Marek Zarychta Reviewed by: olce Tested by: Marek Zarychta Approved by: olce Fixes: 7669cbd0f064 (“acpi: Suspend-to-idle support (s2idle)”) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54777 sys/dev/acpica/acpi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Thank you for fixing it !
And thank you for reporting this and testing the fix so promptly :)