X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=target%2Flinux%2Fatheros%2Fpatches-2.6.37%2F001-get_c0_compare_int_fix.patch;fp=target%2Flinux%2Fatheros%2Fpatches-2.6.37%2F001-get_c0_compare_int_fix.patch;h=43da96c3fe4b56fe9b116c9b7528e3904d7450d0;hp=0000000000000000000000000000000000000000;hb=05b6dae3dd0e3a44155c79c5e557c4e9946743f5;hpb=85d2355e64f40e35d64d958dc92ffd90e66917ba;ds=sidebyside diff --git a/target/linux/atheros/patches-2.6.37/001-get_c0_compare_int_fix.patch b/target/linux/atheros/patches-2.6.37/001-get_c0_compare_int_fix.patch new file mode 100644 index 0000000000..43da96c3fe --- /dev/null +++ b/target/linux/atheros/patches-2.6.37/001-get_c0_compare_int_fix.patch @@ -0,0 +1,39 @@ +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 + +--- 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); +