From b78f936f01826d199b8c9bebee52b045a8979af8 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 16 Feb 2022 20:20:37 +0000 Subject: 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(-) (limited to 'sys/dev') 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); -- cgit v1.2.3