|
@@ -211,9 +211,6 @@ static __cpuinit void sync_master(void *arg)
|
|
{
|
|
{
|
|
unsigned long flags, i;
|
|
unsigned long flags, i;
|
|
|
|
|
|
- if (smp_processor_id() != 0)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
go[MASTER] = 0;
|
|
go[MASTER] = 0;
|
|
|
|
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
@@ -262,7 +259,7 @@ get_delta(long *rt, long *master)
|
|
return tcenter - best_tm;
|
|
return tcenter - best_tm;
|
|
}
|
|
}
|
|
|
|
|
|
-static __cpuinit void sync_tsc(void)
|
|
|
|
|
|
+static __cpuinit void sync_tsc(unsigned int master)
|
|
{
|
|
{
|
|
int i, done = 0;
|
|
int i, done = 0;
|
|
long delta, adj, adjust_latency = 0;
|
|
long delta, adj, adjust_latency = 0;
|
|
@@ -276,9 +273,17 @@ static __cpuinit void sync_tsc(void)
|
|
} t[NUM_ROUNDS] __cpuinitdata;
|
|
} t[NUM_ROUNDS] __cpuinitdata;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+ printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n",
|
|
|
|
+ smp_processor_id(), master);
|
|
|
|
+
|
|
go[MASTER] = 1;
|
|
go[MASTER] = 1;
|
|
|
|
|
|
- smp_call_function(sync_master, NULL, 1, 0);
|
|
|
|
|
|
+ /* It is dangerous to broadcast IPI as cpus are coming up,
|
|
|
|
+ * as they may not be ready to accept them. So since
|
|
|
|
+ * we only need to send the ipi to the boot cpu direct
|
|
|
|
+ * the message, and avoid the race.
|
|
|
|
+ */
|
|
|
|
+ smp_call_function_single(master, sync_master, NULL, 1, 0);
|
|
|
|
|
|
while (go[MASTER]) /* wait for master to be ready */
|
|
while (go[MASTER]) /* wait for master to be ready */
|
|
no_cpu_relax();
|
|
no_cpu_relax();
|
|
@@ -322,16 +327,14 @@ static __cpuinit void sync_tsc(void)
|
|
printk(KERN_INFO
|
|
printk(KERN_INFO
|
|
"CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
|
|
"CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
|
|
"maxerr %lu cycles)\n",
|
|
"maxerr %lu cycles)\n",
|
|
- smp_processor_id(), boot_cpu_id, delta, rt);
|
|
|
|
|
|
+ smp_processor_id(), master, delta, rt);
|
|
}
|
|
}
|
|
|
|
|
|
static void __cpuinit tsc_sync_wait(void)
|
|
static void __cpuinit tsc_sync_wait(void)
|
|
{
|
|
{
|
|
if (notscsync || !cpu_has_tsc)
|
|
if (notscsync || !cpu_has_tsc)
|
|
return;
|
|
return;
|
|
- printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n", smp_processor_id(),
|
|
|
|
- boot_cpu_id);
|
|
|
|
- sync_tsc();
|
|
|
|
|
|
+ sync_tsc(boot_cpu_id);
|
|
}
|
|
}
|
|
|
|
|
|
static __init int notscsync_setup(char *s)
|
|
static __init int notscsync_setup(char *s)
|