diff options
author | 2010-04-07 17:46:30 +0000 | |
---|---|---|
committer | 2010-04-07 17:46:30 +0000 | |
commit | ebb6cb884e1f89d04f015aa8da6ee3b1b0618aef (patch) | |
tree | 89d6d555f084486fc7348558edcd7323c25d46a1 /sys | |
parent | txq->lastds is only valid when txq is not empty. (diff) | |
download | wireguard-openbsd-ebb6cb884e1f89d04f015aa8da6ee3b1b0618aef.tar.xz wireguard-openbsd-ebb6cb884e1f89d04f015aa8da6ee3b1b0618aef.zip |
If we have done a wsdisplay_suspend(), and ACPI decides it does not want to
suspend, we must roll back by calling wsdisplay_resume() or the virtual
console switching will be locked forever
ok oga
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b66e45732b3..948e265e78d 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.156 2010/04/07 06:33:06 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.157 2010/04/07 17:46:30 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2031,6 +2031,7 @@ int acpi_prepare_sleep_state(struct acpi_softc *sc, int state) { struct aml_value env; + int error = 0; if (sc == NULL || state == ACPI_STATE_S0) return(0); @@ -2070,7 +2071,8 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state) if (state == ACPI_STATE_S3) if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND) != 0) { acpi_handle_suspend_failure(sc); - return (1); + error = ENXIO; + goto fail; } #endif /* ! SMALL_KERNEL */ @@ -2079,7 +2081,8 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state) if (aml_evalnode(sc, sc->sc_pts, 1, &env, NULL) != 0) { dnprintf(10, "%s evaluating method _PTS failed.\n", DEVNAME(sc)); - return (ENXIO); + error = ENXIO; + goto fail; } sc->sc_state = state; @@ -2088,13 +2091,19 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state) if (aml_evalnode(sc, sc->sc_gts, 1, &env, NULL) != 0) { dnprintf(10, "%s evaluating method _GTS failed.\n", DEVNAME(sc)); - return (ENXIO); + error = ENXIO; + goto fail; } /* Enable wake GPEs */ acpi_susp_resume_gpewalk(sc, state, 1); - return (0); +fail: +#if NWSDISPLAY > 0 + if (error) + wsdisplay_resume(); +#endif /* NWSDISPLAY > 0 */ + return (error); } |