]> git.hungrycats.org Git - linux/commitdiff
[power] Make sure we only have one CPU running before suspending.
authorPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 06:09:54 +0000 (23:09 -0700)
committerPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 06:09:54 +0000 (23:09 -0700)
Yeah, it sucks for now. But, we'll get it right eventually.

kernel/power/main.c

index 12e2989ef9e1d10a79222fb5e3f661fe8855fdad..71648de7aa81a7267c3e3d5f84ae911274aa2571 100644 (file)
@@ -172,6 +172,12 @@ static int enter_state(u32 state)
        if (down_trylock(&pm_sem))
                return -EBUSY;
 
+       /* Suspend is hard to get right on SMP. */
+       if (num_online_cpus() != 1) {
+               error = -EPERM;
+               goto Unlock;
+       }
+
        if ((error = suspend_prepare(state)))
                goto Unlock;