Skip to content

Commit b8802f7

Browse files
hzhuang1Jason Cooper
authored andcommitted
irqchip: gic: Use mask field in GICC_IAR
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>
1 parent c9eaa44 commit b8802f7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/irqchip/irq-gic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
287287

288288
do {
289289
irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
290-
irqnr = irqstat & ~0x1c00;
290+
irqnr = irqstat & GICC_IAR_INT_ID_MASK;
291291

292292
if (likely(irqnr > 15 && irqnr < 1021)) {
293293
irqnr = irq_find_mapping(gic->domain, irqnr);

include/linux/irqchip/arm-gic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#define GIC_CPU_ACTIVEPRIO 0xd0
2222
#define GIC_CPU_IDENT 0xfc
2323

24+
#define GICC_IAR_INT_ID_MASK 0x3ff
25+
2426
#define GIC_DIST_CTRL 0x000
2527
#define GIC_DIST_CTR 0x004
2628
#define GIC_DIST_IGROUP 0x080

0 commit comments

Comments
 (0)