summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2022-11-10 10:37:41 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2022-11-10 10:37:41 +0000
commit63ceb005451da4d240db4a505b47b1e5854aecd9 (patch)
tree1071e8229a978fd98f9047bbbf1736f297250d3f
parenta7f36092feb875d40924789f60221349ab6ab5ff (diff)
Put CPUs in the lowest P-state just before the final suspend step. The
firmware probably does this for us on ACPI systems with proper S3 support, but this doesn't happen on systems where we park CPUs in a low-power idle state ourselves. ok deraadt@
-rw-r--r--sys/kern/subr_suspend.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_suspend.c b/sys/kern/subr_suspend.c
index 58f8ef5be19..ad156f92ce3 100644
--- a/sys/kern/subr_suspend.c
+++ b/sys/kern/subr_suspend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_suspend.c,v 1.13 2022/11/05 19:29:46 cheloha Exp $ */
+/* $OpenBSD: subr_suspend.c,v 1.14 2022/11/10 10:37:40 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -142,6 +142,9 @@ top:
boothowto |= RB_POWERDOWN;
config_suspend_all(DVACT_POWERDOWN);
boothowto &= ~RB_POWERDOWN;
+
+ if (cpu_setperf != NULL)
+ cpu_setperf(0);
}
error = gosleep(v);