From 6a28311c92099e739572acf4b057aa6386e75add Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 8 Nov 2022 14:54:47 +0000 Subject: [PATCH] acpihpet(4): disable/reenable acpihpet_delay() during suspend/resume We can't use the HPET to delay(9) after we halt it during suspend. Disable acpihpet_delay() before we halt the HPET and reenable it after we restart the HPET during resume. ok mlarkin@ --- sys/dev/acpi/acpihpet.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpi/acpihpet.c b/sys/dev/acpi/acpihpet.c index 7b7898ff185..50be09a17a3 100644 --- a/sys/dev/acpi/acpihpet.c +++ b/sys/dev/acpi/acpihpet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpihpet.c,v 1.29 2022/09/12 10:58:05 cheloha Exp $ */ +/* $OpenBSD: acpihpet.c,v 1.30 2022/11/08 14:54:47 cheloha Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -109,6 +109,8 @@ acpihpet_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + delay_fini(acpihpet_delay); + /* stop, then save */ bus_space_write_4(sc->sc_iot, sc->sc_ioh, HPET_CONFIGURATION, sc->sc_conf); @@ -169,6 +171,8 @@ acpihpet_activate(struct device *self, int act) HPET_TIMER2_COMPARE, sc->sc_save.timers[2].compare); bus_space_write_4(sc->sc_iot, sc->sc_ioh, HPET_CONFIGURATION, sc->sc_conf | 1); + + delay_init(acpihpet_delay, 2000); break; } -- 2.20.1