From patchwork Tue Jan 17 17:40:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13104937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31E70C54E76 for ; Tue, 17 Jan 2023 17:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=q0cs+dG63Ly6QhtdQRB1oK4xCrC+VAEVoY/OMEEJTo4=; b=1jGWESBPn7KxGB RZm60f2n0aIXcRJjIVC552u46OwIXEF+fZ6r62cagcA5xAUV88Qd2Ad5Pd68L+4j2ZEdX3k8T1+4K LpeWXe3cwX7sfhRkFFlqOWjqH5x+kwiT/9sU8d/w431aXxsFM5U0s6+agA3j3lX65OlkV9qX0UqZ9 T83Pt6LkpgoR3qHOu4r7Vf/u9Db4GrddgxEEFfTTqP6g6qIkYzpAu1tkuFKyLqBDv1jOyDMBSIHGc JScBNukU6O2YfFkU6xw5MFClYkoB47eHJNCkHwX92OVcI7yVV3M0zGIFTi0OJyadyjYATN4wQAIac GDs0ojd6KCPxkXXHYhMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHpxk-00FICq-G7; Tue, 17 Jan 2023 17:41:32 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHpxg-00FIC9-RZ for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2023 17:41:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0AF6B6149D; Tue, 17 Jan 2023 17:41:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D910C433D2; Tue, 17 Jan 2023 17:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673977285; bh=7sRYg3qUp1zqUtwwm1zqghInj+DpINupYaUM6cJPwO8=; h=From:To:Cc:Subject:Date:From; b=jLFCnswtz4VyxrS6RmPl+G0KohWAEBrP/xQVe0QM4oFIAeV178SCKf2YcB5/Gy+1R 82q7Twb1dVKGrcayBFFq7Ov1TCqPb3GgffeGl0tgV/p9O5YzNJMu66yT3Fi6HOUGLN He949qf8kqPfHYFSW4kivpWFjVtDQWDxViyjz3RHVYye61fIqRlMG5lPgUQONrfybC GkUx5mJyC6pNbtuTbdV8fS8VR2pIs80x8qb3m6VrcQiihU1i34Dwm2VzIcwpZ7B2kC 6Tg8k3qpP+1hKeNh2LFP+l5K0U2AjW+rBPS7v55+Lobi8xC41eECeBwQz9R8RJSTF4 dokrtgual6pGw== From: Arnd Bergmann To: Russell King Cc: Marc Zyngier , Arnd Bergmann , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Sebastian Andrzej Siewior , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: irq: remove handle_IRQ() for good Date: Tue, 17 Jan 2023 18:40:47 +0100 Message-Id: <20230117174117.3314951-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230117_094128_995568_2392E3E8 X-CRM114-Status: GOOD ( 19.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The only difference between generic_handle_irq() and the ARM handle_IRQ() version is now the range check, and in the remaining drivers this does not appear to be needed any more. Remove this old interface and use the generic version in its place. Signed-off-by: Arnd Bergmann Acked-by: Robert Jarzmik Acked-by: Gregory CLEMENT --- arch/arm/include/asm/irq.h | 4 ---- arch/arm/kernel/irq.c | 25 ------------------------- arch/arm/mach-dove/irq.c | 6 ++---- arch/arm/mach-mv78xx0/irq.c | 9 +++------ arch/arm/mach-orion5x/irq.c | 3 +-- arch/arm/mach-pxa/irq.c | 4 ++-- 6 files changed, 8 insertions(+), 43 deletions(-) diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h index a7c2337b0c7d..f62fa9f36192 100644 --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -23,10 +23,6 @@ #endif #ifndef __ASSEMBLY__ -struct irqaction; -struct pt_regs; - -void handle_IRQ(unsigned int, struct pt_regs *); void init_IRQ(void); #ifdef CONFIG_SMP diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index fe28fc1f759d..e0983269729f 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -96,31 +96,6 @@ int arch_show_interrupts(struct seq_file *p, int prec) return 0; } -/* - * handle_IRQ handles all hardware IRQ's. Decoded IRQs should - * not come via this function. Instead, they should provide their - * own 'handler'. Used by platform code implementing C-based 1st - * level decoding. - */ -void handle_IRQ(unsigned int irq, struct pt_regs *regs) -{ - struct irq_desc *desc; - - /* - * Some hardware gives randomly wrong interrupts. Rather - * than crashing, do something sensible. - */ - if (unlikely(!irq || irq >= nr_irqs)) - desc = NULL; - else - desc = irq_to_desc(irq); - - if (likely(desc)) - handle_irq_desc(desc); - else - ack_bad_irq(irq); -} - void __init init_IRQ(void) { int ret; diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c index 027a8f87bc2e..500f097e09b3 100644 --- a/arch/arm/mach-dove/irq.c +++ b/arch/arm/mach-dove/irq.c @@ -47,15 +47,13 @@ __exception_irq_entry dove_legacy_handle_irq(struct pt_regs *regs) stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_LOW_OFF); stat &= readl_relaxed(dove_irq_base + IRQ_MASK_LOW_OFF); if (stat) { - unsigned int hwirq = 1 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(1 + __fls(stat)); return; } stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_HIGH_OFF); stat &= readl_relaxed(dove_irq_base + IRQ_MASK_HIGH_OFF); if (stat) { - unsigned int hwirq = 33 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(33 + __fls(stat)); return; } } diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c index a34b6855fb19..6114ccbcdab2 100644 --- a/arch/arm/mach-mv78xx0/irq.c +++ b/arch/arm/mach-mv78xx0/irq.c @@ -31,22 +31,19 @@ __exception_irq_entry mv78xx0_legacy_handle_irq(struct pt_regs *regs) stat = readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_LOW_OFF); stat &= readl_relaxed(mv78xx0_irq_base + IRQ_MASK_LOW_OFF); if (stat) { - unsigned int hwirq = __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(__fls(stat)); return; } stat = readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_HIGH_OFF); stat &= readl_relaxed(mv78xx0_irq_base + IRQ_MASK_HIGH_OFF); if (stat) { - unsigned int hwirq = 32 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(32 + __fls(stat)); return; } stat = readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_ERR_OFF); stat &= readl_relaxed(mv78xx0_irq_base + IRQ_MASK_ERR_OFF); if (stat) { - unsigned int hwirq = 64 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(64 + __fls(stat)); return; } } diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c index e17727e53cb4..41d08934a918 100644 --- a/arch/arm/mach-orion5x/irq.c +++ b/arch/arm/mach-orion5x/irq.c @@ -31,8 +31,7 @@ __exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs) stat = readl_relaxed(MAIN_IRQ_CAUSE); stat &= readl_relaxed(MAIN_IRQ_MASK); if (stat) { - unsigned int hwirq = 1 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(1 + __fls(stat)); return; } } diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 96f33ef1d9ea..1fe551b60eed 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -101,7 +101,7 @@ asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs) if (mask == 0) break; - handle_IRQ(PXA_IRQ(fls(mask) - 1), regs); + generic_handle_irq(PXA_IRQ(fls(mask) - 1)); } while (1); } @@ -115,7 +115,7 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs) if ((ichp & ICHP_VAL_IRQ) == 0) break; - handle_IRQ(PXA_IRQ(ICHP_IRQ(ichp)), regs); + generic_handle_irq(PXA_IRQ(ICHP_IRQ(ichp))); } while (1); }