[PATCH] s390: fix non smp build of kexec
[pandora-kernel.git] / arch / s390 / kernel / machine_kexec.c
index 2721c3a..bad81b5 100644 (file)
  * on the S390 architecture.
  */
 
-#include <asm/cio.h>
-#include <asm/setup.h>
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <linux/kexec.h>
 #include <linux/delay.h>
+#include <asm/cio.h>
+#include <asm/setup.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/system.h>
+#include <asm/smp.h>
 
 static void kexec_halt_all_cpus(void *);
 
@@ -70,6 +71,8 @@ machine_kexec(struct kimage *image)
        for (;;);
 }
 
+extern void pfault_fini(void);
+
 static void
 kexec_halt_all_cpus(void *kernel_image)
 {
@@ -78,7 +81,12 @@ kexec_halt_all_cpus(void *kernel_image)
        struct kimage *image;
        relocate_kernel_t data_mover;
 
-       if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid))
+#ifdef CONFIG_PFAULT
+       if (MACHINE_IS_VM)
+               pfault_fini();
+#endif
+
+       if (atomic_cmpxchg(&cpuid, -1, smp_processor_id()) != -1)
                signal_processor(smp_processor_id(), sigp_stop);
 
        /* Wait for all other cpus to enter stopped state */