Commit dcc1ff98 authored by Patrick Mochel's avatar Patrick Mochel

[power] Make sure we only have one CPU running before suspending.

Yeah, it sucks for now. But, we'll get it right eventually. 
parent 32885332
...@@ -172,6 +172,12 @@ static int enter_state(u32 state) ...@@ -172,6 +172,12 @@ static int enter_state(u32 state)
if (down_trylock(&pm_sem)) if (down_trylock(&pm_sem))
return -EBUSY; return -EBUSY;
/* Suspend is hard to get right on SMP. */
if (num_online_cpus() != 1) {
error = -EPERM;
goto Unlock;
}
if ((error = suspend_prepare(state))) if ((error = suspend_prepare(state)))
goto Unlock; goto Unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment