svn commit: r333222 - in head/sys: dev/acpica dev/acpica/Osd x86/acpica
Jung-uk Kim
jkim at FreeBSD.org
Thu May 3 19:00:51 UTC 2018
Author: jkim
Date: Thu May 3 19:00:50 2018
New Revision: 333222
URL: https://svnweb.freebsd.org/changeset/base/333222
Log:
Redo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce.
AcpiOsEnterSleep() was meant to implement this feature.
Reviewed by: avg
Modified:
head/sys/dev/acpica/Osd/OsdHardware.c
head/sys/dev/acpica/acpi.c
head/sys/x86/acpica/acpi_wakeup.c
Modified: head/sys/dev/acpica/Osd/OsdHardware.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 18:20:35 2018 (r333221)
+++ head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 19:00:50 2018 (r333222)
@@ -37,9 +37,15 @@ __FBSDID("$FreeBSD$");
#include <machine/iodev.h>
#include <machine/pci_cfgreg.h>
+extern int acpi_susp_bounce;
+
ACPI_STATUS
AcpiOsEnterSleep(UINT8 SleepState, UINT32 RegaValue, UINT32 RegbValue)
{
+
+ /* If testing device suspend only, back out of everything here. */
+ if (acpi_susp_bounce)
+ return (AE_CTRL_TERMINATE);
return (AE_OK);
}
Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c Thu May 3 18:20:35 2018 (r333221)
+++ head/sys/dev/acpica/acpi.c Thu May 3 19:00:50 2018 (r333222)
@@ -287,15 +287,10 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, default_register_wid
/* Allow users to override quirks. */
TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
-static int acpi_susp_bounce;
+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.
@@ -2951,10 +2946,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
goto backout;
}
slp_state = ACPI_SS_DEV_SUSPEND;
-
- /* If testing device suspend only, back out of everything here. */
- if (acpi_susp_bounce)
- goto backout;
status = AcpiEnterSleepStatePrep(state);
if (ACPI_FAILURE(status)) {
Modified: head/sys/x86/acpica/acpi_wakeup.c
==============================================================================
--- head/sys/x86/acpica/acpi_wakeup.c Thu May 3 18:20:35 2018 (r333221)
+++ head/sys/x86/acpica/acpi_wakeup.c Thu May 3 19:00:50 2018 (r333222)
@@ -79,7 +79,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024);
extern int acpi_resume_beep;
extern int acpi_reset_video;
-extern int acpi_susp_deep_bounce;
+extern int acpi_susp_bounce;
#ifdef SMP
extern struct susppcb **susppcbs;
@@ -277,9 +277,6 @@ 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();
@@ -291,6 +288,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
AcpiFormatException(status));
return (0); /* couldn't sleep */
}
+
+ if (acpi_susp_bounce)
+ resumectx(pcb);
for (;;)
ia32_pause();
More information about the svn-src-all
mailing list