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 Index: linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c
8 ===================================================================
9 --- linux-2.6.32.7.orig/arch/mips/kernel/cevt-r4k.c 2010-01-29 00:06:20.000000000 +0100
10 +++ linux-2.6.32.7/arch/mips/kernel/cevt-r4k.c 2010-02-03 16:59:28.310430064 +0100
12 struct clock_event_device *cd;
15 - if (!cpu_has_counter || !mips_hpt_frequency)
18 - if (!c0_compare_int_usable())
22 * With vectored interrupts things are getting platform specific.
23 * get_c0_compare_int is a hook to allow a platform to return the
24 * interrupt number of it's liking.
26 irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
27 - if (get_c0_compare_int)
28 + if (get_c0_compare_int) {
29 irq = get_c0_compare_int();
30 + if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8))
31 + cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE;
34 + if (!cpu_has_counter || !mips_hpt_frequency)
37 + if (!c0_compare_int_usable())
40 cd = &per_cpu(mips_clockevent_device, cpu);