--- zzzz-none-000/linux-2.6.28.10/arch/mips/kernel/sync-r4k.c 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/arch/mips/kernel/sync-r4k.c 2010-03-09 12:51:36.000000000 +0000 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -20,9 +21,10 @@ #include #include -static atomic_t __initdata count_start_flag = ATOMIC_INIT(0); -static atomic_t __initdata count_count_start = ATOMIC_INIT(0); -static atomic_t __initdata count_count_stop = ATOMIC_INIT(0); +static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0); +static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0); +static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0); +static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0); #define COUNTON 100 #define NR_LOOPS 5 @@ -42,19 +44,20 @@ return; #endif - pr_info("Checking COUNT synchronization across %u CPUs: ", - num_online_cpus()); - + printk(KERN_INFO "Synchronize counters across %u CPUs: ", + num_online_cpus()); + local_irq_save(flags); /* * Notify the slaves that it's time to start */ + atomic_set(&count_reference, read_c0_count()); atomic_set(&count_start_flag, 1); smp_wmb(); - /* Count will be initialised to expirelo for all CPU's */ - initcount = expirelo; + /* Count will be initialised */ + initcount = read_c0_count(); /* * We loop a few times to get a primed instruction cache, @@ -106,7 +109,7 @@ printk("done.\n"); } -void __init synchronise_count_slave(void) +void __cpuinit synchronise_count_slave(void) { int i; unsigned long flags; @@ -131,8 +134,8 @@ while (!atomic_read(&count_start_flag)) mb(); - /* Count will be initialised to expirelo for all CPU's */ - initcount = expirelo; + /* Count will be initialised to next expire for all CPU's */ + initcount = atomic_read(&count_reference); ncpus = num_online_cpus(); for (i = 0; i < NR_LOOPS; i++) {