irqchip: gic: Use mask field in GICC_IAR
authorHaojian Zhuang <haojian.zhuang@linaro.org>
Sun, 11 May 2014 08:05:58 +0000 (16:05 +0800)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 07:41:38 +0000 (09:41 +0200)
Bit[9:0] is interrupt ID field in GICC_IAR. Bit[12:10] is CPU ID field,
and others are reserved.

So we should use GICC_IAR_INT_ID_MASK to get interrupt ID. It's not a good way
to use ~0x1c00 (CPU ID field) to get interrupt ID.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Link: https://lkml.kernel.org/r/1399795571-17231-3-git-send-email-haojian.zhuang@linaro.org
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
(cherry picked from commit b8802f76fe473d91886220498aeda157c492f2d1)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
drivers/irqchip/irq-gic.c
include/linux/irqchip/arm-gic.h

index 922f7ba37d5cd362aca4a84d01b3821e4ba21460..949a53d03a26921dc65de40791323d9198c53326 100644 (file)
@@ -287,7 +287,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 
        do {
                irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
-               irqnr = irqstat & ~0x1c00;
+               irqnr = irqstat & GICC_IAR_INT_ID_MASK;
 
                if (likely(irqnr > 15 && irqnr < 1021)) {
                        irqnr = irq_find_mapping(gic->domain, irqnr);
index fcb02d7637ec5746a552842614160ecf949af397..14faee7c97143314ebb6d7628ccb418619bc74a0 100644 (file)
@@ -18,6 +18,8 @@
 #define GIC_CPU_RUNNINGPRI             0x14
 #define GIC_CPU_HIGHPRI                        0x18
 
+#define GICC_IAR_INT_ID_MASK           0x3ff
+
 #define GIC_DIST_CTRL                  0x000
 #define GIC_DIST_CTR                   0x004
 #define GIC_DIST_IGROUP                        0x080