From b396fb91afa3c7c94236263237dc577799620833 Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 10 Nov 2022 10:37:40 +0000 Subject: [PATCH] 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@ --- sys/kern/subr_suspend.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 * Copyright (c) 2005 Jordan Hargrave @@ -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); -- 2.20.1