From 82ba4f821958adff0f348c5880da6005895e75eb Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 13 Aug 2024 22:31:16 +0000 Subject: [PATCH] use ACPI _WAK upon resume. Such a huge oversight it is surprising that we've never noticed it before, maybe systems which depend on _WAK are rare. Still, this may improve S3 resume on some rare machines. ok kettenis --- sys/dev/acpi/acpi_x86.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c index e44ea352672..d1d2d212137 100644 --- a/sys/dev/acpi/acpi_x86.c +++ b/sys/dev/acpi/acpi_x86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_x86.c,v 1.29 2024/08/11 17:30:28 deraadt Exp $ */ +/* $OpenBSD: acpi_x86.c,v 1.30 2024/08/13 22:31:16 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -126,6 +126,10 @@ gosleep(void *v) sc->sc_pmc_resume(sc->sc_pmc_cookie); acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ + + /* 1st resume AML step: _WAK(fromstate) */ + if (sc->sc_state != ACPI_STATE_S0) + aml_node_setval(sc, sc->sc_wak, sc->sc_state); return ret; } -- 2.20.1