1 Fix the usage of get_c0_compare_int: override cp0_compare_irq if the returned
2 value is in the MIPS CPU IRQ range to ensure that c0_compare_int_usable()
5 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
7 --- a/arch/mips/kernel/cevt-r4k.c
8 +++ b/arch/mips/kernel/cevt-r4k.c
9 @@ -168,20 +168,23 @@ int __cpuinit r4k_clockevent_init(void)
10 struct clock_event_device *cd;
13 - if (!cpu_has_counter || !mips_hpt_frequency)
16 - if (!c0_compare_int_usable())
20 * With vectored interrupts things are getting platform specific.
21 * get_c0_compare_int is a hook to allow a platform to return the
22 * interrupt number of it's liking.
24 irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
25 - if (get_c0_compare_int)
26 + if (get_c0_compare_int) {
27 irq = get_c0_compare_int();
28 + if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8))
29 + cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE;
32 + if (!cpu_has_counter || !mips_hpt_frequency)
35 + if (!c0_compare_int_usable())
38 cd = &per_cpu(mips_clockevent_device, cpu);