diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-04 15:22:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-04 15:22:00 +0000 |
commit | 4ff410068111e339d596986479ec7eac2fc204d3 (patch) | |
tree | 26a16929932918bdb69306f29a5f5744ee3455c6 /sys/dev | |
parent | 32aa8e06c852ea4387abd5b4a0a583395dcd3d86 (diff) |
If we are setting ACPI_PM1_BM_RLD do it only once, and remember to
repeat this action at resume time.
ok mlarkin guenther
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpi.c | 7 | ||||
-rw-r--r-- | sys/dev/acpi/acpicpu.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index e79c9470682..2b05c37bba1 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.290 2015/07/29 18:33:17 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.291 2015/08/04 15:21:59 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2107,6 +2107,8 @@ acpi_sleep_pm(struct acpi_softc *sc, int state) } } +u_int32_t acpi_force_bm; + void acpi_resume_pm(struct acpi_softc *sc, int fromstate) { @@ -2123,7 +2125,8 @@ acpi_resume_pm(struct acpi_softc *sc, int fromstate) acpi_write_pmreg(sc, ACPIREG_PM1B_CNT, 0, regb); /* Force SCI_EN on resume to fix horribly broken machines */ - acpi_write_pmreg(sc, ACPIREG_PM1_CNT, 0, ACPI_PM1_SCI_EN); + acpi_write_pmreg(sc, ACPIREG_PM1_CNT, 0, + ACPI_PM1_SCI_EN | acpi_force_bm); /* Clear fixed event status */ acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS); diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index c55365f9cb9..ffdcac34f59 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.66 2015/08/04 05:15:02 guenther Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.67 2015/08/04 15:21:59 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> @@ -701,19 +701,21 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux) } } if (!SLIST_EMPTY(&sc->sc_cstates)) { + extern u_int32_t acpi_force_bm; + cpu_idle_cycle_fcn = &acpicpu_idle; /* * C3 (and maybe C2?) needs BM_RLD to be set to * wake the system - * XXX need to save and restore this in suspend/resume? */ - if (SLIST_FIRST(&sc->sc_cstates)->state > 1) { + if (SLIST_FIRST(&sc->sc_cstates)->state > 1 && acpi_force_bm == 0) { uint16_t en = acpi_read_pmreg(sc->sc_acpi, ACPIREG_PM1_CNT, 0); if ((en & ACPI_PM1_BM_RLD) == 0) { acpi_write_pmreg(sc->sc_acpi, ACPIREG_PM1_CNT, 0, en | ACPI_PM1_BM_RLD); + acpi_force_bm = ACPI_PM1_BM_RLD; } } } |