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
This commit is contained in:
parent
41c3e23fd6
commit
aa5ff5bd98
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user