add a new ACPI suspend debugging knob, debug.acpi.suspend_deep_bounce

This sysctl allows a deeper dive into the sleep abyss comparing to
debug.acpi.suspend_bounce.  When the new sysctl is set the system will
execute the suspend sequence up to the call to AcpiEnterSleepState().
That includes saving processor contexts and parking APs.  Then, instead
of actually entering the sleep state, the BSP will call resumectx() to
emulate the wakeup.  The APs should get restarted by the sequence of
Init and Startup IPIs that BSP sends to them.

MFC after:	8 days
This commit is contained in:
Andriy Gapon 2018-04-24 09:42:58 +00:00
parent d357c16adc
commit e673a4ec4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332918
2 changed files with 9 additions and 0 deletions

View File

@ -291,6 +291,11 @@ 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.");
int acpi_susp_deep_bounce;
SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_deep_bounce, CTLFLAG_RW,
&acpi_susp_deep_bounce, 0, "Don't actually suspend, "
"bail out just before entering the sleep state.");
/*
* 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.

View File

@ -79,6 +79,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024);
extern int acpi_resume_beep;
extern int acpi_reset_video;
extern int acpi_susp_deep_bounce;
#ifdef SMP
extern struct susppcb **susppcbs;
@ -264,6 +265,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
PTD[KPTDI] = PTD[LOWPTDI];
#endif
if (acpi_susp_deep_bounce)
resumectx(pcb);
/* Call ACPICA to enter the desired sleep state */
if (state == ACPI_STATE_S4 && sc->acpi_s4bios)
status = AcpiEnterSleepStateS4bios();