Date: Tue, 26 May 2026 13:32:34 +0000 From: Olivier Certner <olce@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 44eb2883134e - main - acpi: On /dev/power suspend, trigger userspace notifications Message-ID: <6a15a0f2.47575.30956a8c@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=44eb2883134e465c28468213f79567c64fe26de1 commit 44eb2883134e465c28468213f79567c64fe26de1 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2026-05-25 16:01:10 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2026-05-26 13:32:04 +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 --- 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 8be94db73729..4c6d0c3679c9 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -5064,7 +5064,7 @@ acpi_pm_func(u_long cmd, void *arg, enum power_stype stype) error = EINVAL; goto out; } - if (ACPI_FAILURE(acpi_EnterSleepState(sc, stype))) + if (ACPI_FAILURE(acpi_ReqSleepState(sc, stype))) error = ENXIO; break; default:home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a15a0f2.47575.30956a8c>
