From 1d28c7e637990ec3edba303439b32e21b89e27e4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 15 Feb 2022 02:38:16 +0000 Subject: [PATCH] MI disable_lid_wakeups() is not needed, x86 systems can do this in sleep_resume(), which seems sensible for other future systems also --- sys/arch/arm64/dev/apm.c | 7 +------ sys/arch/macppc/dev/apm.c | 6 +----- sys/dev/acpi/acpi_x86.c | 11 +++-------- sys/kern/subr_suspend.c | 4 +--- sys/sys/device.h | 3 +-- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/sys/arch/arm64/dev/apm.c b/sys/arch/arm64/dev/apm.c index 4e809bea00b..f50aef6e0b4 100644 --- a/sys/arch/arm64/dev/apm.c +++ b/sys/arch/arm64/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.12 2022/02/11 01:55:12 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.13 2022/02/15 02:38:16 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -437,10 +437,5 @@ suspend_finish(void *v) #endif } -void -disable_lid_wakeups(void *v) -{ -} - #endif /* SUSPEND */ diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c index 9921dbda41e..ea912dd81d4 100644 --- a/sys/arch/macppc/dev/apm.c +++ b/sys/arch/macppc/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.28 2022/02/12 16:22:40 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.29 2022/02/15 02:38:17 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -401,8 +401,4 @@ suspend_finish(void *v) { } -void -disable_lid_wakeups(void *v) -{ -} #endif /* SUSPEND */ diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c index dd7d9a54bb1..de9a7373210 100644 --- a/sys/dev/acpi/acpi_x86.c +++ b/sys/dev/acpi/acpi_x86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_x86.c,v 1.4 2022/02/15 02:29:23 deraadt Exp $ */ +/* $OpenBSD: acpi_x86.c,v 1.5 2022/02/15 02:38:17 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -140,6 +140,8 @@ sleep_resume(void *v) { struct acpi_softc *sc = v; + acpibtn_disable_psw(); /* disable _LID for wakeup */ + /* 3rd resume AML step: _TTS(runstate) */ if (aml_node_setval(sc, sc->sc_tts, sc->sc_state) != 0) return (EINVAL); @@ -161,13 +163,6 @@ suspend_finish(void *v) acpi_addtask(sc, acpi_sleep_task, sc, sc->sc_state); } -void -disable_lid_wakeups(void *v) -{ - acpibtn_disable_psw(); /* disable _LID for wakeup */ - -} - void display_suspend(void *v) { diff --git a/sys/kern/subr_suspend.c b/sys/kern/subr_suspend.c index 03754b6e1c8..6c34b27df89 100644 --- a/sys/kern/subr_suspend.c +++ b/sys/kern/subr_suspend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_suspend.c,v 1.4 2022/02/13 15:56:55 deraadt Exp $ */ +/* $OpenBSD: subr_suspend.c,v 1.5 2022/02/15 02:38:18 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -139,8 +139,6 @@ fail_suspend: intr_enable(); splx(s); - disable_lid_wakeups(v); - inittodr(gettime()); sleep_resume(v); diff --git a/sys/sys/device.h b/sys/sys/device.h index ad4e449c28d..a0d5a7d629f 100644 --- a/sys/sys/device.h +++ b/sys/sys/device.h @@ -1,4 +1,4 @@ -/* $OpenBSD: device.h,v 1.58 2022/02/11 01:55:12 deraadt Exp $ */ +/* $OpenBSD: device.h,v 1.59 2022/02/15 02:38:18 deraadt Exp $ */ /* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */ /* @@ -211,7 +211,6 @@ void gosleep(void *v); void display_suspend(void *v); void display_resume(void *v); void suspend_finish(void *v); -void disable_lid_wakeups(void *v); struct device *device_mainbus(void); struct device *device_mpath(void); -- 2.20.1