irqchip/gic: Make interrupt ID 1020 invalid
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 16 Dec 2015 14:11:22 +0000 (14:11 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 16 Dec 2015 15:30:51 +0000 (15:30 +0000)
The GIC has no such thing as interrupt 1020: the last valid ID is
1019, and the range 1020-1023 is reserved - 1023 indicating that
no interrupt is pending. So let's make sure we don't try to handle
this ID.

This bug has been in since the initial GIC code was introduced in
8ad68bbf7a06 ("[ARM] Add support for ARM RealView board").

Reported-by: Eric Auger <eric.auger@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-gic.c

index 174990c56d27ba1e0b94dca3bf30102cd10b46b0..7f5f91984c1b0418f4fe6d63053efedb44936b3b 100644 (file)
@@ -337,7 +337,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
                irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
                irqnr = irqstat & GICC_IAR_INT_ID_MASK;
 
-               if (likely(irqnr > 15 && irqnr < 1021)) {
+               if (likely(irqnr > 15 && irqnr < 1020)) {
                        if (static_key_true(&supports_deactivate))
                                writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
                        handle_domain_irq(gic->domain, irqnr, regs);