aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/acpica/acpi.c11
-rw-r--r--sys/dev/acpica/acpivar.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 2a6ca655a1840..82b974522bb46 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -427,6 +427,10 @@ acpi_attach(device_t dev)
SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "verbose", CTLFLAG_RD | CTLFLAG_RW,
&sc->acpi_verbose, 0, "verbose mode");
+ SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
+ OID_AUTO, "disable_on_poweroff", CTLFLAG_RD | CTLFLAG_RW,
+ &sc->acpi_disable_on_poweroff, 0, "ACPI subsystem disable on poweroff");
+ sc->acpi_disable_on_poweroff = 1;
sc->acpi_sleep_delay = 0;
sc->acpi_s4bios = 1;
if (bootverbose)
@@ -869,8 +873,10 @@ static void
acpi_shutdown_pre_sync(void *arg, int howto)
{
+ struct acpi_softc *sc = arg;
+
ACPI_ASSERTLOCK;
-
+
/*
* Disable all ACPI events before soft off, otherwise the system
* will be turned on again on some laptops.
@@ -879,7 +885,8 @@ acpi_shutdown_pre_sync(void *arg, int howto)
* before powering down, since we may still need ACPI during the
* shutdown process.
*/
- acpi_Disable((struct acpi_softc *)arg);
+ if (sc->acpi_disable_on_poweroff)
+ acpi_Disable(sc);
}
static void
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index 0cfe4464e40e5..f43b6db60be13 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -65,6 +65,7 @@ struct acpi_softc {
int acpi_sleep_delay;
int acpi_s4bios;
+ int acpi_disable_on_poweroff;
int acpi_verbose;