summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2024-08-08 07:02:39 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2024-08-08 07:02:39 +0000
commitde1e4fbf2dd8371b1da5fe54e825ac08e144a83f (patch)
treec44393c6b0f36b07b34f30f5854d67115a880a19 /sys/dev
parent86d0e1a454bb307a2daeacfc7b8e5515b3b30ff8 (diff)
Print suspend-to-idle debug info in a more concise matter.
ok mlarkin@, deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi_x86.c8
-rw-r--r--sys/dev/acpi/acpivar.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c
index b0927ca7de0..e08435d25c8 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.24 2024/08/06 17:38:56 kettenis Exp $ */
+/* $OpenBSD: acpi_x86.c,v 1.25 2024/08/08 07:02:38 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -87,6 +87,7 @@ sleep_setstate(void *v)
int
gosleep(void *v)
{
+ extern int cpu_wakeups;
struct acpi_softc *sc = v;
int ret;
@@ -107,10 +108,13 @@ gosleep(void *v)
if (sc->sc_pmc_suspend)
sc->sc_pmc_suspend(sc->sc_pmc_cookie);
+ cpu_wakeups = 0;
sc->sc_wakeup = 0;
+ sc->sc_wakeups = 0;
while (!sc->sc_wakeup) {
ret = acpi_sleep_cpu(sc, sc->sc_state);
acpi_resume_cpu(sc, sc->sc_state);
+ sc->sc_wakeups++;
if (sc->sc_ec && sc->sc_wakegpe == sc->sc_ec->sc_gpe) {
sc->sc_wakeup = 0;
@@ -160,8 +164,10 @@ checklids(struct acpi_softc *sc)
int
suspend_finish(void *v)
{
+ extern int cpu_wakeups;
struct acpi_softc *sc = v;
+ printf("wakeups: %d %d\n", cpu_wakeups, sc->sc_wakeups);
printf("wakeup event: ");
switch (sc->sc_wakegpe) {
case 0:
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 4ec231772ef..c7e17c4bdc0 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.133 2024/08/06 17:38:56 kettenis Exp $ */
+/* $OpenBSD: acpivar.h,v 1.134 2024/08/08 07:02:38 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -265,6 +265,7 @@ struct acpi_softc {
struct aml_node *sc_wak;
int sc_state;
int sc_wakeup;
+ int sc_wakeups;
time_t sc_resume_time;
struct acpiec_softc *sc_ec; /* XXX assume single EC */