aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-11-21 11:39:44 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-11-26 12:26:14 -0500
commit5aa85c9fc49a6ce44dc10a42e2011bbde9dc445a (patch)
tree14b8d1a014349568be39753f879c152e1e3f2b41 /include/asm-mips
parent0f67e90e1caea4a0a14d2c60102547bce29f7f08 (diff)
[MIPS] Handle R4000/R4400 mfc0 from count register.
The R4000 and R4400 have an errata where if the cp0 count register is read in the exact moment when it matches the compare register no interrupt will be generated. This bug may be triggered if the cp0 count register is being used as clocksource and the compare interrupt as clockevent. So a simple workaround is to avoid using the compare for both facilities on the affected CPUs. This is different from the workaround suggested in the old errata documents; at some opportunity probably the official version should be implemented and tested. Another thing to find out is which processor versions exactly are affected. I only have errata documents upto R4400 V3.0 available so for the moment the code treats all R4000 and R4400 as broken. This is potencially a problem for some machines that have no other decent clocksource available; this workaround will cause them to fall back to another clocksource, worst case the "jiffies" source.
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/time.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index ee1663e64da1..1922494a0d9e 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -58,11 +58,12 @@ extern int (*perf_irq)(void);
58 * Initialize the calling CPU's compare interrupt as clockevent device 58 * Initialize the calling CPU's compare interrupt as clockevent device
59 */ 59 */
60#ifdef CONFIG_CEVT_R4K 60#ifdef CONFIG_CEVT_R4K
61extern void mips_clockevent_init(void); 61extern int mips_clockevent_init(void);
62extern unsigned int __weak get_c0_compare_int(void); 62extern unsigned int __weak get_c0_compare_int(void);
63#else 63#else
64static inline void mips_clockevent_init(void) 64static inline int mips_clockevent_init(void)
65{ 65{
66 return -ENXIO;
66} 67}
67#endif 68#endif
68 69