1 --- a/arch/mips/kernel/traps.c
2 +++ b/arch/mips/kernel/traps.c
3 @@ -1578,7 +1578,16 @@ void __cpuinit per_cpu_trap_init(void)
5 cp0_compare_irq_shift = CAUSEB_TI - CAUSEB_IP;
6 cp0_compare_irq = (read_c0_intctl() >> INTCTLB_IPTI) & 7;
7 + if (!cp0_compare_irq)
8 + cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ;
10 cp0_perfcount_irq = (read_c0_intctl() >> INTCTLB_IPPCI) & 7;
11 + if (!cp0_perfcount_irq)
12 + cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ;
14 + if (arch_fixup_c0_irqs)
15 + arch_fixup_c0_irqs();
17 if (cp0_perfcount_irq == cp0_compare_irq)
18 cp0_perfcount_irq = -1;
20 --- a/arch/mips/include/asm/irq.h
21 +++ b/arch/mips/include/asm/irq.h
22 @@ -138,9 +138,11 @@ extern void free_irqno(unsigned int irq)
23 * IE7. Since R2 their number has to be read from the c0_intctl register.
25 #define CP0_LEGACY_COMPARE_IRQ 7
26 +#define CP0_LEGACY_PERFCNT_IRQ 7
28 extern int cp0_compare_irq;
29 extern int cp0_compare_irq_shift;
30 extern int cp0_perfcount_irq;
31 +extern void __weak arch_fixup_c0_irqs(void);
33 #endif /* _ASM_IRQ_H */