From 2e0288d2b705f039522f4b9701d876cbe538a2ba Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 15 Mar 2026 11:16:36 +0000 Subject: [PATCH] Apparently we shouldn't touch the RTC before restarting the i8254 clock when coming out of S3 suspend. This makes the x250 lock up. ok jsg@, deraadt@ --- sys/arch/amd64/amd64/acpi_machdep.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index 8f4b90ac622..6e1f3363f5c 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.113 2026/03/11 16:18:42 kettenis Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.114 2026/03/15 11:16:36 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -481,10 +481,10 @@ acpi_resume_cpu(struct acpi_softc *sc, int state) sc->sc_wakegpe = WAKEGPE_RTC; } - rtcalarm_resume(); - - if (state == ACPI_STATE_S0) + if (state == ACPI_STATE_S0) { + rtcalarm_resume(); return; + } cpu_init_msrs(&cpu_info_primary); cpu_fix_msrs(&cpu_info_primary); @@ -504,6 +504,7 @@ acpi_resume_cpu(struct acpi_softc *sc, int state) #endif i8254_startclock(); + rtcalarm_resume(); /* i8254 must be running */ if (initclock_func == i8254_initclocks) rtcstart(); /* in i8254 mode, rtc is profclock */