padata: Use the online cpumask as the default
[linux-flexiantxendom0-3.2.10.git] / kernel / kexec.c
index 60bf181..a6a675c 100644 (file)
@@ -1129,6 +1129,7 @@ int crash_shrink_memory(unsigned long new_size)
 {
        int ret = 0;
        unsigned long start, end;
+       unsigned long old_size;
        struct resource *ram_res;
 
        mutex_lock(&kexec_mutex);
@@ -1139,11 +1140,9 @@ int crash_shrink_memory(unsigned long new_size)
        }
        start = crashk_res.start;
        end = crashk_res.end;
-
-       if (new_size >= end - start + 1) {
-               ret = -EINVAL;
-               if (new_size == end - start + 1)
-                       ret = 0;
+       old_size = (end == 0) ? 0 : end - start + 1;
+       if (new_size >= old_size) {
+               ret = (new_size == old_size) ? 0 : -EINVAL;
                goto unlock;
        }
 
@@ -1547,13 +1546,13 @@ int kernel_kexec(void)
                if (error)
                        goto Resume_console;
                /* At this point, dpm_suspend_start() has been called,
-                * but *not* dpm_suspend_noirq(). We *must* call
-                * dpm_suspend_noirq() now.  Otherwise, drivers for
+                * but *not* dpm_suspend_end(). We *must* call
+                * dpm_suspend_end() now.  Otherwise, drivers for
                 * some devices (e.g. interrupt controllers) become
                 * desynchronized with the actual state of the
                 * hardware at resume time, and evil weirdness ensues.
                 */
-               error = dpm_suspend_noirq(PMSG_FREEZE);
+               error = dpm_suspend_end(PMSG_FREEZE);
                if (error)
                        goto Resume_devices;
                error = disable_nonboot_cpus();
@@ -1580,7 +1579,7 @@ int kernel_kexec(void)
                local_irq_enable();
  Enable_cpus:
                enable_nonboot_cpus();
-               dpm_resume_noirq(PMSG_RESTORE);
+               dpm_resume_start(PMSG_RESTORE);
  Resume_devices:
                dpm_resume_end(PMSG_RESTORE);
  Resume_console: