Date: Mon, 8 Nov 2010 20:25:19 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r215006 - in stable/8: share/man/man4 sys/dev/acpica Message-ID: <201011082025.oA8KPJrh051621@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon Nov 8 20:25:19 2010 New Revision: 215006 URL: http://svn.freebsd.org/changeset/base/215006 Log: MFC: r213755 Use AcpiReset() from ACPICA instead of rolling our own, which is actually incomplete. If FADT says the register is available, enable the capability by default. Remove the previous default value from acpi(4). Modified: stable/8/share/man/man4/acpi.4 stable/8/sys/dev/acpica/acpi.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Mon Nov 8 20:21:24 2010 (r215005) +++ stable/8/share/man/man4/acpi.4 Mon Nov 8 20:25:19 2010 (r215006) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2010 +.Dd October 12, 2010 .Dt ACPI 4 .Os .Sh NAME @@ -112,7 +112,6 @@ exiting to legacy mode first. Default is 0, leave ACPI enabled. .It Va hw.acpi.handle_reboot Use the ACPI Reset Register capability to reboot the system. -Default is 0, use legacy reboot support. Some newer systems require use of this register, while some only work with legacy rebooting support. .It Va hw.acpi.lid_switch_state Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Mon Nov 8 20:21:24 2010 (r215005) +++ stable/8/sys/dev/acpica/acpi.c Mon Nov 8 20:25:19 2010 (r215006) @@ -590,6 +590,10 @@ acpi_attach(device_t dev) freeenv(env); } + /* Only enable reboot by default if the FADT says it is available. */ + if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) + sc->acpi_handle_reboot = 1; + /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; @@ -1828,19 +1832,15 @@ acpi_shutdown_final(void *arg, int howto DELAY(1000000); device_printf(sc->acpi_dev, "power-off failed - timeout\n"); } - } else if ((howto & RB_HALT) == 0 && - (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) && - sc->acpi_handle_reboot) { + } else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) { /* Reboot using the reset register. */ - status = AcpiWrite( - AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister); - if (ACPI_FAILURE(status)) - device_printf(sc->acpi_dev, "reset failed - %s\n", - AcpiFormatException(status)); - else { + status = AcpiReset(); + if (ACPI_SUCCESS(status)) { DELAY(1000000); device_printf(sc->acpi_dev, "reset failed - timeout\n"); - } + } else if (status != AE_NOT_EXIST) + device_printf(sc->acpi_dev, "reset failed - %s\n", + AcpiFormatException(status)); } else if (sc->acpi_do_disable && panicstr == NULL) { /* * Only disable ACPI if the user requested. On some systems, writing
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011082025.oA8KPJrh051621>