Date: Thu, 23 Jul 2026 10:00:51 +0000 From: Olivier Certner <olce@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5af7d6930bf3 - stable/14 - acpi: On /dev/power suspend, trigger userspace notifications Message-ID: <6a61e653.3bcc6.87f0caa@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5af7d6930bf32a980b99c830e3fe58149771d177 commit 5af7d6930bf32a980b99c830e3fe58149771d177 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2026-05-25 16:01:10 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2026-07-23 09:59:08 +0000 acpi: On /dev/power suspend, trigger userspace notifications On a suspend request via ioctl(), /dev/acpi (and compatible /dev/apm) both call acpi_ReqSleepState() instead of directly calling acpi_EnterSleepState(). The former does more checks, returns success if the machine is already suspending, and notifies user space (via devd(8)) about the impending suspend. In other words, it seems to have been designed for user consumption more than the latter function. So, use acpi_ReqSleepState() in place of acpi_EnterSleepState() in acpi_pm_func(), which is ultimately called by power_pm_suspend(), itself called by power_ioctl(). Other callers of power_pm_suspend() (such as the console drivers) are also user-facing facilities, so should also benefit from this change. Reviewed by: mhorne, imp Tested by: mhorne MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57239 (cherry picked from commit 44eb2883134e465c28468213f79567c64fe26de1) --- sys/dev/acpica/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index e9c346e371d9..bf8d2d59c83a 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -4731,7 +4731,7 @@ acpi_pm_func(u_long cmd, void *arg, ...) goto out; } - if (ACPI_FAILURE(acpi_EnterSleepState(sc, acpi_state))) + if (ACPI_FAILURE(acpi_ReqSleepState(sc, acpi_state))) error = ENXIO; break; default:home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a61e653.3bcc6.87f0caa>
