diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-01-19 07:00:55 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-02-05 08:56:53 -0500 |
commit | ae58d882bfd3e537b1ed4a4c3577ca9ba853f0d8 (patch) | |
tree | 94c7b0cc96305c93d09aca129302432037939803 | |
parent | 2d76e9633b572ae5a64150b638eed77f4afc12db (diff) |
MIPS: cevt-r4k: Drop GIC special case
The cevt-r4k driver used to call into the GIC driver to find whether the
timer was pending, but only with External Interrupt Controller (EIC)
mode, where the Cause.IP bits can't be used as they encode the interrupt
priority level (Cause.RIPL) instead.
However commit e9de688dac65 ("irqchip: mips-gic: Support local
interrupts") changed the condition from cpu_has_veic to gic_present.
This fails on cores such as P5600 which have a GIC but the local
interrupts aren't routable by the GIC, causing c0_compare_int_usable()
to consider the interrupt unusable so r4k_clockevent_init() fails.
The previous behaviour, added in commit 98b67c37db33 ("MIPS: Add EIC
support for GIC."), wasn't really correct either as far as I can tell,
since P5600 apparently supports EIC mode too, and in any case the use of
Cause.TI with r2 should have been sufficient anyway since commit
010c108d7af7 ("MIPS: PowerTV: Fix support for timer interrupts with > 64
external IRQs").
Therefore drop the call into the gic driver altogether, and add a
comment in c0_compare_int_pending() to clarify that Cause.TI does get
checked since MIPS r2.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Fixes: e9de688dac65 ("irqchip: mips-gic: Support local interrupts")
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Steven J. Hill <steven.hill@imgtec.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9077/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/cevt-r4k.c | 6 | ||||
-rw-r--r-- | drivers/irqchip/irq-mips-gic.c | 8 | ||||
-rw-r--r-- | include/linux/irqchip/mips-gic.h | 1 |
3 files changed, 1 insertions, 14 deletions
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 6acaad0480af..28bfdf2c59a5 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/percpu.h> | 11 | #include <linux/percpu.h> |
12 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/irqchip/mips-gic.h> | ||
15 | 14 | ||
16 | #include <asm/time.h> | 15 | #include <asm/time.h> |
17 | #include <asm/cevt-r4k.h> | 16 | #include <asm/cevt-r4k.h> |
@@ -85,10 +84,7 @@ void mips_event_handler(struct clock_event_device *dev) | |||
85 | */ | 84 | */ |
86 | static int c0_compare_int_pending(void) | 85 | static int c0_compare_int_pending(void) |
87 | { | 86 | { |
88 | #ifdef CONFIG_MIPS_GIC | 87 | /* When cpu_has_mips_r2, this checks Cause.TI instead of Cause.IP7 */ |
89 | if (gic_present) | ||
90 | return gic_get_timer_pending(); | ||
91 | #endif | ||
92 | return (read_c0_cause() >> cp0_compare_irq_shift) & (1ul << CAUSEB_IP); | 88 | return (read_c0_cause() >> cp0_compare_irq_shift) & (1ul << CAUSEB_IP); |
93 | } | 89 | } |
94 | 90 | ||
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 2b0468e3df6a..e58600b1de28 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c | |||
@@ -191,14 +191,6 @@ static bool gic_local_irq_is_routable(int intr) | |||
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | unsigned int gic_get_timer_pending(void) | ||
195 | { | ||
196 | unsigned int vpe_pending; | ||
197 | |||
198 | vpe_pending = gic_read(GIC_REG(VPE_LOCAL, GIC_VPE_PEND)); | ||
199 | return vpe_pending & GIC_VPE_PEND_TIMER_MSK; | ||
200 | } | ||
201 | |||
202 | static void gic_bind_eic_interrupt(int irq, int set) | 194 | static void gic_bind_eic_interrupt(int irq, int set) |
203 | { | 195 | { |
204 | /* Convert irq vector # to hw int # */ | 196 | /* Convert irq vector # to hw int # */ |
diff --git a/include/linux/irqchip/mips-gic.h b/include/linux/irqchip/mips-gic.h index 420f77b34d02..e6a6aac451db 100644 --- a/include/linux/irqchip/mips-gic.h +++ b/include/linux/irqchip/mips-gic.h | |||
@@ -243,7 +243,6 @@ extern void gic_write_cpu_compare(cycle_t cnt, int cpu); | |||
243 | extern void gic_send_ipi(unsigned int intr); | 243 | extern void gic_send_ipi(unsigned int intr); |
244 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); | 244 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); |
245 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); | 245 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); |
246 | extern unsigned int gic_get_timer_pending(void); | ||
247 | extern int gic_get_c0_compare_int(void); | 246 | extern int gic_get_c0_compare_int(void); |
248 | extern int gic_get_c0_perfcount_int(void); | 247 | extern int gic_get_c0_perfcount_int(void); |
249 | #endif /* __LINUX_IRQCHIP_MIPS_GIC_H */ | 248 | #endif /* __LINUX_IRQCHIP_MIPS_GIC_H */ |