From d1b16e1864fb834873322e90ce0bf74dcc457ae2 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Sat, 29 Jul 2006 21:46:16 +0000 Subject: [PATCH] Add a new sysctl, hw.acpi.handle_reboot. If set, acpi will attempt to perform the reboot action via the reset register instead of our legacy method. Default is 0 (use legacy). This is needed because some systems hang on reboot even though they claim to support the reset register. MFC after: 2 days --- sys/dev/acpica/acpi.c | 6 +++++- sys/dev/acpica/acpivar.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index d740a3abbeb..84f9e7153e6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -525,6 +525,9 @@ acpi_attach(device_t dev) SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "disable_on_reboot", CTLFLAG_RW, &sc->acpi_do_disable, 0, "Disable ACPI when rebooting/halting system"); + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "handle_reboot", CTLFLAG_RW, + &sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot"); /* * Default to 1 second before sleeping to give some machines time to @@ -1658,7 +1661,8 @@ acpi_shutdown_final(void *arg, int howto) DELAY(1000000); printf("ACPI power-off failed - timeout\n"); } - } else if ((howto & RB_HALT) == 0 && AcpiGbl_FADT->ResetRegSup) { + } else if ((howto & RB_HALT) == 0 && AcpiGbl_FADT->ResetRegSup && + sc->acpi_handle_reboot) { /* Reboot using the reset register. */ status = AcpiHwLowLevelWrite( AcpiGbl_FADT->ResetRegister.RegisterBitWidth, diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 1618287cdc4..df3940aeba2 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -47,7 +47,7 @@ struct acpi_softc { device_t acpi_dev; - struct cdev *acpi_dev_t; + struct cdev *acpi_dev_t; struct resource *acpi_irq; int acpi_irq_rid; @@ -70,6 +70,7 @@ struct acpi_softc { int acpi_s4bios; int acpi_do_disable; int acpi_verbose; + int acpi_handle_reboot; bus_dma_tag_t acpi_waketag; bus_dmamap_t acpi_wakemap;