]> err.no Git - linux-2.6/blobdiff - kernel/power/main.c
[ACPI] merge acpi-2.6.12 branch into latest Linux 2.6.13-rc...
[linux-2.6] / kernel / power / main.c
index 454434716f35ccf477c7f7e535a6abc6942e72fe..71aa0fd22007d8c5c188a4ce62c516726fd228d2 100644 (file)
@@ -59,6 +59,13 @@ static int suspend_prepare(suspend_state_t state)
 
        pm_prepare_console();
 
+       disable_nonboot_cpus();
+
+       if (num_online_cpus() != 1) {
+               error = -EPERM;
+               goto Enable_cpu;
+       }
+
        if (freeze_processes()) {
                error = -EAGAIN;
                goto Thaw;
@@ -89,6 +96,8 @@ static int suspend_prepare(suspend_state_t state)
                pm_ops->finish(state);
  Thaw:
        thaw_processes();
+ Enable_cpu:
+       enable_nonboot_cpus();
        pm_restore_console();
        return error;
 }
@@ -127,6 +136,7 @@ static void suspend_finish(suspend_state_t state)
        if (pm_ops && pm_ops->finish)
                pm_ops->finish(state);
        thaw_processes();
+       enable_nonboot_cpus();
        pm_restore_console();
 }
 
@@ -164,12 +174,6 @@ static int enter_state(suspend_state_t state)
                goto Unlock;
        }
 
-       /* Suspend is hard to get right on SMP. */
-       if (num_online_cpus() != 1) {
-               error = -EPERM;
-               goto Unlock;
-       }
-
        pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
        if ((error = suspend_prepare(state)))
                goto Unlock;