svn commit: r332918 - in head/sys: dev/acpica x86/acpica

Andriy Gapon avg at FreeBSD.org
Tue Apr 24 09:42:59 UTC 2018


Author: avg
Date: Tue Apr 24 09:42:58 2018
New Revision: 332918
URL: https://svnweb.freebsd.org/changeset/base/332918

Log:
  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

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/x86/acpica/acpi_wakeup.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Tue Apr 24 08:48:20 2018	(r332917)
+++ head/sys/dev/acpica/acpi.c	Tue Apr 24 09:42:58 2018	(r332918)
@@ -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.

Modified: head/sys/x86/acpica/acpi_wakeup.c
==============================================================================
--- head/sys/x86/acpica/acpi_wakeup.c	Tue Apr 24 08:48:20 2018	(r332917)
+++ head/sys/x86/acpica/acpi_wakeup.c	Tue Apr 24 09:42:58 2018	(r332918)
@@ -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;
@@ -263,6 +264,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)


More information about the svn-src-head mailing list