summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-06-24 00:48:45 +0000
committernjl <njl@FreeBSD.org>2004-06-24 00:48:45 +0000
commitab7b1075ef4b1c6ef29f25ba0f7951a3ae6c418f (patch)
tree5a53dbef2dbec7346e82b86c21772605fd68075c /sys/dev/acpica
parentf22a8169c3e592aeeea3ebbec7a1cecfd2605340 (diff)
downloadFreeBSD-src-ab7b1075ef4b1c6ef29f25ba0f7951a3ae6c418f.zip
FreeBSD-src-ab7b1075ef4b1c6ef29f25ba0f7951a3ae6c418f.tar.gz
Run the power off code directly instead of using indirection through
smp_rendezvous() to ensure we run on the BSP. This reverts rev 1.128. Add a comment indicating that MI code should be the one that runs all shutdown functions on the BSP with the APs halted. This should work around problems in power off while waiting for the MI code to be improved.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 510cf55..7b79995 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -129,7 +129,6 @@ static int acpi_probe_order(ACPI_HANDLE handle, int *order);
static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level,
void *context, void **status);
static void acpi_shutdown_final(void *arg, int howto);
-static void acpi_shutdown_poweroff(void *arg);
static void acpi_enable_fixed_events(struct acpi_softc *sc);
static int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw);
static ACPI_STATUS acpi_wake_limit(ACPI_HANDLE h, UINT32 level, void *context,
@@ -1282,9 +1281,9 @@ acpi_shutdown_final(void *arg, int howto)
ACPI_STATUS status;
/*
- * If powering off, run the actual shutdown code on each processor.
- * It will only perform the shutdown on the BSP. Some chipsets do
- * not power off the system correctly if called from an AP.
+ * XXX Shutdown code should only run on the BSP (cpuid 0).
+ * Some chipsets do not power off the system correctly if called from
+ * an AP.
*/
if ((howto & RB_POWEROFF) != 0) {
status = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
@@ -1294,36 +1293,20 @@ acpi_shutdown_final(void *arg, int howto)
return;
}
printf("Powering system off using ACPI\n");
- smp_rendezvous(NULL, acpi_shutdown_poweroff, NULL, NULL);
+ ACPI_DISABLE_IRQS();
+ status = AcpiEnterSleepState(ACPI_STATE_S5);
+ if (ACPI_FAILURE(status)) {
+ printf("ACPI power-off failed - %s\n", AcpiFormatException(status));
+ } else {
+ DELAY(1000000);
+ printf("ACPI power-off failed - timeout\n");
+ }
} else {
printf("Shutting down ACPI\n");
AcpiTerminate();
}
}
-/*
- * Since this function may be called with locks held or in an unknown
- * context, it cannot allocate memory, acquire locks, sleep, etc.
- */
-static void
-acpi_shutdown_poweroff(void *arg)
-{
- ACPI_STATUS status;
-
- /* Only attempt to power off if this is the BSP (cpuid 0). */
- if (PCPU_GET(cpuid) != 0)
- return;
-
- ACPI_DISABLE_IRQS();
- status = AcpiEnterSleepState(ACPI_STATE_S5);
- if (ACPI_FAILURE(status)) {
- printf("ACPI power-off failed - %s\n", AcpiFormatException(status));
- } else {
- DELAY(1000000);
- printf("ACPI power-off failed - timeout\n");
- }
-}
-
static void
acpi_enable_fixed_events(struct acpi_softc *sc)
{
OpenPOWER on IntegriCloud