linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: irq: remove handle_IRQ() for good
@ 2023-01-17 17:40 Arnd Bergmann
  2023-01-23 15:28 ` Robert Jarzmik
  2023-01-31 16:41 ` Gregory CLEMENT
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-01-17 17:40 UTC (permalink / raw)
  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,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 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);
 }
 
-- 
2.39.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: irq: remove handle_IRQ() for good
  2023-01-17 17:40 [PATCH] ARM: irq: remove handle_IRQ() for good Arnd Bergmann
@ 2023-01-23 15:28 ` Robert Jarzmik
  2023-01-31 16:41 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2023-01-23 15:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Russell King, Marc Zyngier, Arnd Bergmann, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Sebastian Andrzej Siewior,
	Andy Shevchenko, linux-arm-kernel, linux-kernel


Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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.
For PXA:
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

--
Robert

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: irq: remove handle_IRQ() for good
  2023-01-17 17:40 [PATCH] ARM: irq: remove handle_IRQ() for good Arnd Bergmann
  2023-01-23 15:28 ` Robert Jarzmik
@ 2023-01-31 16:41 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2023-01-31 16:41 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King
  Cc: Marc Zyngier, Arnd Bergmann, Andrew Lunn, Sebastian Hesselbarth,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Sebastian Andrzej Siewior, Andy Shevchenko, linux-arm-kernel,
	linux-kernel

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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 <arnd@arndb.de>
> ---
>  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 ++--

For mvebu related platform

Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>

Thanks,

Gregory


>  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);
>  }
>  
> -- 
> 2.39.0
>

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-31 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 17:40 [PATCH] ARM: irq: remove handle_IRQ() for good Arnd Bergmann
2023-01-23 15:28 ` Robert Jarzmik
2023-01-31 16:41 ` Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).