Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / s390 / kernel / machine_kexec.c
index 5aa71b0..60b1ea9 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 *);
 
 typedef void (*relocate_kernel_t) (kimage_entry_t *, unsigned long);
 
-const extern unsigned char relocate_kernel[];
-const extern unsigned long long relocate_kernel_len;
+extern const unsigned char relocate_kernel[];
+extern const unsigned long long relocate_kernel_len;
 
 int
 machine_kexec_prepare(struct kimage *image)
@@ -62,6 +63,7 @@ NORET_TYPE void
 machine_kexec(struct kimage *image)
 {
        clear_all_subchannels();
+       cio_reset_channel_paths();
 
        /* Disable lowcore protection */
        ctl_clear_bit(0,28);
@@ -85,7 +87,7 @@ kexec_halt_all_cpus(void *kernel_image)
                pfault_fini();
 #endif
 
-       if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid))
+       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 */