@@ -528,12 +528,10 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
}
/*
- * wait to see if the cpu made a callin (is actually up).
- * use this value that I found through experimentation.
- * -- Cort
+ * Wait until cpu puts itself in the online map
*/
if (system_state < SYSTEM_RUNNING)
- for (c = 50000; c && !cpu_callin_map[cpu]; c--)
+ for (c = 50000; c && !cpu_online(cpu); c--)
udelay(100);
#ifdef CONFIG_HOTPLUG_CPU
else
@@ -541,11 +539,10 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
* CPUs can take much longer to come up in the
* hotplug case. Wait five seconds.
*/
- for (c = 5000; c && !cpu_callin_map[cpu]; c--)
+ for (c = 5000; c && !cpu_online(cpu); c--)
msleep(1);
#endif
-
- if (!cpu_callin_map[cpu]) {
+ if (!cpu_online(cpu)) {
printk(KERN_ERR "Processor %u is stuck.\n", cpu);
return -ENOENT;
}
@@ -555,8 +552,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
if (smp_ops->give_timebase)
smp_ops->give_timebase();
- /* Wait until cpu puts itself in the online map */
- while (!cpu_online(cpu))
+ /* Wait until cpu synchronized clock */
+ while (!cpu_callin_map[cpu])
cpu_relax();
return 0;
@@ -703,10 +700,6 @@ void start_secondary(void *unused)
if (smp_ops->setup_cpu)
smp_ops->setup_cpu(cpu);
- if (smp_ops->take_timebase)
- smp_ops->take_timebase();
-
- secondary_cpu_time_init();
#ifdef CONFIG_PPC64
if (system_state == SYSTEM_RUNNING)
@@ -738,6 +731,10 @@ void start_secondary(void *unused)
notify_cpu_starting(cpu);
set_cpu_online(cpu, true);
+ if (smp_ops->take_timebase)
+ smp_ops->take_timebase();
+
+ secondary_cpu_time_init();
/*
* CPU must be marked active and online before we signal back to the
* master, because the scheduler needs to see the cpu_online and