1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-14 19:23:53 +02:00
openwrt/target/linux/atheros/patches-2.6.38/001-get_c0_compare_int_fix.patch
Alexandros C. Couloumbis 8b7a516fa8 linux/atheros: add 2.6.38 preliminary support
SVN-Revision: 26772
2011-04-27 17:18:03 +00:00

40 lines
1.1 KiB
Diff

Fix the usage of get_c0_compare_int: override cp0_compare_irq if the returned
value is in the MIPS CPU IRQ range to ensure that c0_compare_int_usable()
still works.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -168,20 +168,23 @@ int __cpuinit r4k_clockevent_init(void)
struct clock_event_device *cd;
unsigned int irq;
- if (!cpu_has_counter || !mips_hpt_frequency)
- return -ENXIO;
-
- if (!c0_compare_int_usable())
- return -ENXIO;
-
/*
* With vectored interrupts things are getting platform specific.
* get_c0_compare_int is a hook to allow a platform to return the
* interrupt number of it's liking.
*/
irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
- if (get_c0_compare_int)
+ if (get_c0_compare_int) {
irq = get_c0_compare_int();
+ if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8))
+ cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE;
+ }
+
+ if (!cpu_has_counter || !mips_hpt_frequency)
+ return -ENXIO;
+
+ if (!c0_compare_int_usable())
+ return -ENXIO;
cd = &per_cpu(mips_clockevent_device, cpu);