summaryrefslogtreecommitdiffstats
path: root/target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-09-24 19:24:03 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-09-24 19:24:03 +0000
commitcd04be271418d7026e85583c003bd147100b7d9c (patch)
tree823b64136f4193e2614a53ecd57d9dec6dad62b6 /target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch
parent19b9e51722f249a7e208c127de810afdfe07833f (diff)
atheros: add config and patches for 2.6.31 (untested), includes patch from #5847
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17700 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch')
-rw-r--r--target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch b/target/linux/atheros/patches-2.6.31/001-get_c0_compare_int_fix.patch
new file mode 100644
index 000000000..43da96c3f
--- /dev/null
+++ b/target/linux/atheros/patches-2.6.31/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 <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);
+