From nobody Sun Sep 14 22:28:31 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5359DC677F1 for ; Tue, 17 Jan 2023 17:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230472AbjAQRz2 (ORCPT ); Tue, 17 Jan 2023 12:55:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231205AbjAQRvn (ORCPT ); Tue, 17 Jan 2023 12:51:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A9ED29E0C for ; Tue, 17 Jan 2023 09:41:28 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id C7844B81928 for ; 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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: Gregory CLEMENT Acked-by: Robert Jarzmik --- 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 =20 #ifndef __ASSEMBLY__ -struct irqaction; -struct pt_regs; - -void handle_IRQ(unsigned int, struct pt_regs *); void init_IRQ(void); =20 #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; } =20 -/* - * 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 >=3D nr_irqs)) - desc =3D NULL; - else - desc =3D 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 =3D readl_relaxed(dove_irq_base + IRQ_CAUSE_LOW_OFF); stat &=3D readl_relaxed(dove_irq_base + IRQ_MASK_LOW_OFF); if (stat) { - unsigned int hwirq =3D 1 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(1 + __fls(stat)); return; } stat =3D readl_relaxed(dove_irq_base + IRQ_CAUSE_HIGH_OFF); stat &=3D readl_relaxed(dove_irq_base + IRQ_MASK_HIGH_OFF); if (stat) { - unsigned int hwirq =3D 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 =3D readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_LOW_OFF); stat &=3D readl_relaxed(mv78xx0_irq_base + IRQ_MASK_LOW_OFF); if (stat) { - unsigned int hwirq =3D __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(__fls(stat)); return; } stat =3D readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_HIGH_OFF); stat &=3D readl_relaxed(mv78xx0_irq_base + IRQ_MASK_HIGH_OFF); if (stat) { - unsigned int hwirq =3D 32 + __fls(stat); - handle_IRQ(hwirq, regs); + generic_handle_irq(32 + __fls(stat)); return; } stat =3D readl_relaxed(mv78xx0_irq_base + IRQ_CAUSE_ERR_OFF); stat &=3D readl_relaxed(mv78xx0_irq_base + IRQ_MASK_ERR_OFF); if (stat) { - unsigned int hwirq =3D 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 =3D readl_relaxed(MAIN_IRQ_CAUSE); stat &=3D readl_relaxed(MAIN_IRQ_MASK); if (stat) { - unsigned int hwirq =3D 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(s= truct pt_regs *regs) if (mask =3D=3D 0) break; =20 - handle_IRQ(PXA_IRQ(fls(mask) - 1), regs); + generic_handle_irq(PXA_IRQ(fls(mask) - 1)); } while (1); } =20 @@ -115,7 +115,7 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(s= truct pt_regs *regs) if ((ichp & ICHP_VAL_IRQ) =3D=3D 0) break; =20 - handle_IRQ(PXA_IRQ(ICHP_IRQ(ichp)), regs); + generic_handle_irq(PXA_IRQ(ICHP_IRQ(ichp))); } while (1); } =20 --=20 2.39.0