ACPI/processor: Avoid STARTING/DYING actions in a more logical way
authorRichard Cochran <rcochran@linutronix.de>
Wed, 13 Jul 2016 17:16:38 +0000 (17:16 +0000)
committerIngo Molnar <mingo@kernel.org>
Fri, 15 Jul 2016 08:40:24 +0000 (10:40 +0200)
As part of the hotplug cleanup, the CPU_STARTING/DYING actions are going
away soon.  This driver needlessly uses those two macro, and so this patch
replaces that code with something more sensible.

Commit:

  8da8373447d6a57a5a9f55233d35beb15d92d0d2 ("ACPI / processor: Fix STARTING/DYING action in acpi_cpu_soft_notify()")

added checks for those two actions, because the notification callback can
sleep, causing a hung CPU. This patch instead checks for the ONLINE/DEAD
actions, which are the ones that are handled by the driver in the first
place.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-acpi@vger.kernel.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153335.964962885@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/acpi/processor_driver.c

index d2fa8cb82d2bd34aa4cf289cf4888ae65931757d..eecdb196b2d16f3ffd22fc52fa0eda1252fabb49 100644 (file)
@@ -118,12 +118,13 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
        struct acpi_device *device;
        action &= ~CPU_TASKS_FROZEN;
 
-       /*
-        * CPU_STARTING and CPU_DYING must not sleep. Return here since
-        * acpi_bus_get_device() may sleep.
-        */
-       if (action == CPU_STARTING || action == CPU_DYING)
+       switch (action) {
+       case CPU_ONLINE:
+       case CPU_DEAD:
+               break;
+       default:
                return NOTIFY_DONE;
+       }
 
        if (!pr || acpi_bus_get_device(pr->handle, &device))
                return NOTIFY_DONE;