From: mlarkin Date: Sun, 18 Jul 2010 19:49:35 +0000 (+0000) Subject: Clear event status on resume, to avoid going back to sleep/reboot/shutdown X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4ba701a1d8615ca32c9b37b0b899568c774a1e2a;p=openbsd Clear event status on resume, to avoid going back to sleep/reboot/shutdown immediately after resume. Tested by a bunch of people on hackers@ on various hardware. Fixes at least Toshiba NB200 and Gateway LT3103u. ok marco --- diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index c13b734095b..5878f29104f 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.176 2010/07/13 21:01:05 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.177 2010/07/18 19:49:35 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2096,6 +2096,10 @@ acpi_resume(struct acpi_softc *sc, int state) /* Force SCI_EN on resume to fix horribly broken machines */ acpi_write_pmreg(sc, ACPIREG_PM1_CNT, 0, ACPI_PM1_SCI_EN); + /* Clear fixed event status */ + acpi_write_pmreg(sc, ACPIREG_PM1_STS, 1, + ACPI_PM1_ALL_STS); + if (sc->sc_bfs) if (aml_evalnode(sc, sc->sc_bfs, 1, &env, NULL) != 0) { dnprintf(10, "%s evaluating method _BFS failed.\n",