[MIPS] VSMP: Synchronize cp0 counters on bootup.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+7 -2
+2
arch/mips/kernel/smp-mt.c
··· 153 153 154 154 /* Propagate Config7 */ 155 155 write_vpe_c0_config7(read_c0_config7()); 156 + 157 + write_vpe_c0_count(read_c0_count()); 156 158 } 157 159 158 160 static unsigned int __init smp_vpe_init(unsigned int tc, unsigned int mvpconf0,
+3 -2
arch/mips/mips-boards/generic/time.c
··· 209 209 #endif 210 210 #if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_MALTA) 211 211 unsigned long flags; 212 + unsigned int start; 212 213 213 214 local_irq_save(flags); 214 215 ··· 218 217 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP)); 219 218 220 219 /* Start r4k counter. */ 221 - write_c0_count(0); 220 + start = read_c0_count(); 222 221 223 222 /* Read counter exactly on falling edge of update flag */ 224 223 while (CMOS_READ(RTC_REG_A) & RTC_UIP); 225 224 while (!(CMOS_READ(RTC_REG_A) & RTC_UIP)); 226 225 227 - count = read_c0_count(); 226 + count = read_c0_count() - start; 228 227 229 228 /* restore interrupts */ 230 229 local_irq_restore(flags);
+2
include/asm-mips/mipsmtregs.h
··· 352 352 #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) 353 353 #define read_vpe_c0_vpeconf0() mftc0(1, 2) 354 354 #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) 355 + #define read_vpe_c0_count() mftc0(9, 0) 356 + #define write_vpe_c0_count(val) mttc0(9, 0, val) 355 357 #define read_vpe_c0_status() mftc0(12, 0) 356 358 #define write_vpe_c0_status(val) mttc0(12, 0, val) 357 359 #define read_vpe_c0_cause() mftc0(13, 0)