--- zzzz-none-000/linux-2.6.19.2/kernel/cpu.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/kernel/cpu.c 2007-01-11 07:38:19.000000000 +0000 @@ -58,8 +58,8 @@ recursive_depth--; return; } - recursive = NULL; mutex_unlock(&cpu_bitmask_lock); + recursive = NULL; } EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); @@ -150,19 +150,19 @@ p = __stop_machine_run(take_cpu_down, NULL, cpu); mutex_unlock(&cpu_bitmask_lock); - if (IS_ERR(p) || cpu_online(cpu)) { + if (IS_ERR(p)) { /* CPU didn't die: tell everyone. Can't complain. */ if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, (void *)(long)cpu) == NOTIFY_BAD) BUG(); - if (IS_ERR(p)) { - err = PTR_ERR(p); - goto out_allowed; - } - goto out_thread; + err = PTR_ERR(p); + goto out_allowed; } + if (cpu_online(cpu)) + goto out_thread; + /* Wait for it to sleep (leaving idle task). */ while (!idle_cpu(cpu)) yield();