]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/cpu.c
smp, idle: Allocate idle thread for each possible cpu during boot
[karo-tx-linux.git] / kernel / cpu.c
index 05c46bae5e55ba920d342e9e0247d65f4d76e36a..0e6353cf147abf51c4f760054971915063ece928 100644 (file)
@@ -297,15 +297,18 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
        int ret, nr_calls = 0;
        void *hcpu = (void *)(long)cpu;
        unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
+       struct task_struct *idle;
 
        if (cpu_online(cpu) || !cpu_present(cpu))
                return -EINVAL;
 
        cpu_hotplug_begin();
 
-       ret = smpboot_prepare(cpu);
-       if (ret)
+       idle = idle_thread_get(cpu);
+       if (IS_ERR(idle)) {
+               ret = PTR_ERR(idle);
                goto out;
+       }
 
        ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
        if (ret) {
@@ -316,7 +319,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
        }
 
        /* Arch-specific enabling code. */
-       ret = __cpu_up(cpu, idle_thread_get(cpu));
+       ret = __cpu_up(cpu, idle);
        if (ret != 0)
                goto out_notify;
        BUG_ON(!cpu_online(cpu));