Return-Path: Received: from szxga04-in.huawei.com ([45.249.212.190]:11148 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725933AbeHSJuU (ORCPT ); Sun, 19 Aug 2018 05:50:20 -0400 From: Hanjun Guo To: Greg KH , CC: , Marc Zyngier , "Catalin Marinas" , Hanjun Guo Subject: [PATCH 4.4 6/6] irqchip/gic: Make interrupt ID 1020 invalid Date: Sun, 19 Aug 2018 14:27:41 +0800 Message-ID: <1534660061-51980-7-git-send-email-guohanjun@huawei.com> In-Reply-To: <1534660061-51980-1-git-send-email-guohanjun@huawei.com> References: <1534660061-51980-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: From: Marc Zyngier commit 327ebe1f3a9b7e20e298b39d0cff627169a28012 upstream. 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 Cc: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Hanjun Guo --- drivers/irqchip/irq-gic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index cebd8ef..5fe968a 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -336,7 +336,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); -- 1.7.12.4