From d46e24923c6d99fcb516d831ebe31061eb9c3e51 Mon Sep 17 00:00:00 2001 From: njl Date: Fri, 2 Nov 2007 17:29:36 +0000 Subject: [PATCH] Fix a shutdown hang on some SMP systems. The previous logic was to IPI all CPUs to make sure idle threads are evicted from the softc before returning from acpi_cpu_shutdown(). However, this is unnecessary since stop_cpus() handles this for itself and at this point it's possible that our IPI will be blocked (interrupts disabled). Thanks to: Glen Leeder MFC after: 3 days --- sys/dev/acpica/acpi_cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 324f0a430cb9..eb5ce530e0e7 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -501,12 +501,14 @@ acpi_cpu_shutdown(device_t dev) /* Allow children to shutdown first. */ bus_generic_shutdown(dev); - /* Disable any entry to the idle function. */ + /* + * Disable any entry to the idle function. There is a small race where + * an idle thread have passed this check but not gone to sleep. This + * is ok since device_shutdown() does not free the softc, otherwise + * we'd have to be sure all threads were evicted before returning. + */ cpu_disable_idle = TRUE; - /* Signal and wait for all processors to exit acpi_cpu_idle(). */ - smp_rendezvous(NULL, NULL, NULL, NULL); - return_VALUE (0); }