In order to get rid of all CPU_*_FROZEN states we need to convert all
users first.

cpu_check_up_prepare() wants to report different errors depending on
an ongoing suspend or not. freeze_active() reports back if that is the
case so we don't have to rely on the CPU_DEAD_FROZEN anymore.

Signed-off-by: Daniel Wagner <daniel.wag...@bmw-carit.de>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Chris Metcalf <cmetc...@ezchip.com>
Cc: Don Zickus <dzic...@redhat.com>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Lai Jiangshan <la...@cn.fujitsu.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: "Paul E. McKenney" <paul...@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org
---
 kernel/smpboot.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index e37efbf..49ce4e9 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -13,6 +13,7 @@
 #include <linux/percpu.h>
 #include <linux/kthread.h>
 #include <linux/smpboot.h>
+#include <linux/suspend.h>
 
 #include "smpboot.h"
 
@@ -407,26 +408,25 @@ int cpu_check_up_prepare(int cpu)
        switch (atomic_read(&per_cpu(cpu_hotplug_state, cpu))) {
 
        case CPU_POST_DEAD:
+               if (freeze_active()) {
+                       /*
+                        * Timeout during CPU death, so let caller know.
+                        * The outgoing CPU completed its processing, but after
+                        * cpu_wait_death() timed out and reported the error. 
The
+                        * caller is free to proceed, in which case the state
+                        * will be reset properly by cpu_set_state_online().
+                        * Proceeding despite this -EBUSY return makes sense
+                        * for systems where the outgoing CPUs take themselves
+                        * offline, with no post-death manipulation required 
from
+                        * a surviving CPU.
+                        */
+                       return -EBUSY;
+               }
 
                /* The CPU died properly, so just start it up again. */
                atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE);
                return 0;
 
-       case CPU_DEAD_FROZEN:
-
-               /*
-                * Timeout during CPU death, so let caller know.
-                * The outgoing CPU completed its processing, but after
-                * cpu_wait_death() timed out and reported the error. The
-                * caller is free to proceed, in which case the state
-                * will be reset properly by cpu_set_state_online().
-                * Proceeding despite this -EBUSY return makes sense
-                * for systems where the outgoing CPUs take themselves
-                * offline, with no post-death manipulation required from
-                * a surviving CPU.
-                */
-               return -EBUSY;
-
        case CPU_BROKEN:
 
                /*
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to