From 58b18799dc76415fd48a3c51ea5fce280a421867 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 16 Feb 2022 20:20:36 +0000 Subject: [PATCH] rev 1.4 was wrong to put potential IO operations after _GTS. re-creating the original (2 weeks ago) order of last-minute-disk-parking needs a different approach, hmm. --- sys/dev/acpi/acpi_x86.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c index b9a2980cbcf..5d9e41e9f27 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.9 2022/02/16 07:13:09 deraadt Exp $ */ +/* $OpenBSD: acpi_x86.c,v 1.10 2022/02/16 20:20:36 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -104,12 +104,6 @@ sleep_setstate(void *v) if (aml_node_setval(sc, sc->sc_pts, sc->sc_state) != 0) return (EINVAL); acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ - - acpibtn_enable_psw(); /* enable _LID for wakeup */ - acpi_indicator(sc, ACPI_SST_SLEEPING); - - /* 3rd suspend AML step: _GTS(tostate) */ - aml_node_setval(sc, sc->sc_gts, sc->sc_state); return 0; } @@ -119,6 +113,12 @@ gosleep(void *v) struct acpi_softc *sc = v; int ret; + acpibtn_enable_psw(); /* enable _LID for wakeup */ + acpi_indicator(sc, ACPI_SST_SLEEPING); + + /* 3rd suspend AML step: _GTS(tostate) */ + aml_node_setval(sc, sc->sc_gts, sc->sc_state); + /* Clear fixed event status */ acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS); -- 2.20.1