Move the call to AcpiEnterSleepStatePrep() to before we select the BSP
(cpuid 0) as the processor. It mallocs some data and smp_rendezvous calls functions with locks held.
This commit is contained in:
parent
fa126c2954
commit
904bf0c2f7
@ -1168,6 +1168,12 @@ acpi_shutdown_final(void *arg, int howto)
|
|||||||
* not power off the system correctly if called from an AP.
|
* not power off the system correctly if called from an AP.
|
||||||
*/
|
*/
|
||||||
if ((howto & RB_POWEROFF) != 0) {
|
if ((howto & RB_POWEROFF) != 0) {
|
||||||
|
status = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
printf("AcpiEnterSleepStatePrep failed - %s\n",
|
||||||
|
AcpiFormatException(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
printf("Powering system off using ACPI\n");
|
printf("Powering system off using ACPI\n");
|
||||||
smp_rendezvous(NULL, acpi_shutdown_poweroff, NULL, NULL);
|
smp_rendezvous(NULL, acpi_shutdown_poweroff, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
@ -1176,6 +1182,10 @@ acpi_shutdown_final(void *arg, int howto)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Since this function may be called with locks held or in an unknown
|
||||||
|
* context, it cannot allocate memory, acquire locks, sleep, etc.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
acpi_shutdown_poweroff(void *arg)
|
acpi_shutdown_poweroff(void *arg)
|
||||||
{
|
{
|
||||||
@ -1187,12 +1197,6 @@ acpi_shutdown_poweroff(void *arg)
|
|||||||
if (PCPU_GET(cpuid) != 0)
|
if (PCPU_GET(cpuid) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
status = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
|
|
||||||
if (ACPI_FAILURE(status)) {
|
|
||||||
printf("AcpiEnterSleepStatePrep failed - %s\n",
|
|
||||||
AcpiFormatException(status));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ACPI_DISABLE_IRQS();
|
ACPI_DISABLE_IRQS();
|
||||||
status = AcpiEnterSleepState(ACPI_STATE_S5);
|
status = AcpiEnterSleepState(ACPI_STATE_S5);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user