diff options
author | njl <njl@FreeBSD.org> | 2007-05-25 05:26:21 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-05-25 05:26:21 +0000 |
commit | aa5ff5bd9845d83800faf71692af8bd67e36aa0a (patch) | |
tree | 1de9f759b115f2e00db1f5476fcb74939707d333 | |
parent | 41c3e23fd68cdb8098f8355908ff7d03c7b1840b (diff) | |
download | FreeBSD-src-aa5ff5bd9845d83800faf71692af8bd67e36aa0a.zip FreeBSD-src-aa5ff5bd9845d83800faf71692af8bd67e36aa0a.tar.gz |
Add a sysctl, 'debug.acpi.suspend_bounce', that causes the system to bounce
back in a simulated resume instead of entering the requested suspend state.
This helps in testing drivers separately from the acpi suspend code. To
test your drivers, set debug.acpi.suspend_bounce=1 and then run
acpiconf -s3 (or 4).
MFC after: 1 day
-rw-r--r-- | sys/dev/acpica/acpi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index c6dbb3b..f9b77bf 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -242,6 +242,10 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW, /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); +static int acpi_susp_bounce; +SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, + &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); + /* * ACPI can only be loaded as a module by the loader; activating it after * system bootstrap time is not useful, and can be fatal to the system. @@ -2198,6 +2202,10 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) } slp_state = ACPI_SS_DEV_SUSPEND; + /* If testing device suspend only, back out of everything here. */ + if (acpi_susp_bounce) + break; + status = AcpiEnterSleepStatePrep(state); if (ACPI_FAILURE(status)) { device_printf(sc->acpi_dev, "AcpiEnterSleepStatePrep failed - %s\n", |