Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: riscpc: convert to sparse IRQs
@ 2026-05-10  3:46 Ethan Nelson-Moore
  2026-05-10  3:55 ` Ethan Nelson-Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-10  3:46 UTC (permalink / raw)
  To: linux-arm-kernel, linux-input
  Cc: Ethan Nelson-Moore, Russell King, Dmitry Torokhov,
	Russell King (Oracle), Arnd Bergmann, Linus Walleij, Kees Cook,
	Nathan Chancellor, Steven Rostedt, Thomas Weissschuh,
	Sebastian Andrzej Siewior, Peter Zijlstra

To improve future maintainability, change the interrupt handling for
mach-rpc to use sparse IRQs.

Since the number of possible interrupts is already fixed and relatively
small, just make it use all legacy interrupts preallocated using the
.nr_irqs field in the machine descriptor, rather than actually
allocating domains on the fly.

Several files had to be adjusted to include <mach/irqs.h>
explicitly because it is no longer implicitly included with sparse
IRQs.

Description adapted from commit c78a41fc04f0 ("ARM: s3c24xx: convert
to sparse-irq").

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
This commit depends on my previous submission "ARM: <asm/floppy.h>: fix
build with sparse IRQs".

 arch/arm/Kconfig                      | 2 +-
 arch/arm/mach-rpc/dma.c               | 1 +
 arch/arm/mach-rpc/ecard.c             | 2 +-
 arch/arm/mach-rpc/include/mach/irqs.h | 2 +-
 arch/arm/mach-rpc/irq.c               | 3 ++-
 arch/arm/mach-rpc/riscpc.c            | 2 ++
 arch/arm/mach-rpc/time.c              | 1 +
 drivers/input/mouse/rpcmouse.c        | 2 +-
 drivers/input/serio/rpckbd.c          | 1 +
 9 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 71fc5dd4123f..09b2767fee0f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -153,7 +153,7 @@ config ARM
 	select PCI_SYSCALL if PCI
 	select PERF_USE_VMALLOC
 	select RTC_LIB
-	select SPARSE_IRQ if !(ARCH_FOOTBRIDGE || ARCH_RPC)
+	select SPARSE_IRQ if !ARCH_FOOTBRIDGE
 	select SYS_SUPPORTS_APM_EMULATION
 	select THREAD_INFO_IN_TASK
 	select TIMER_OF if OF
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 717a81475670..238aa59612a8 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -17,6 +17,7 @@
 #include <asm/fiq.h>
 #include <asm/irq.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 #include <linux/uaccess.h>
 
 #include <asm/mach/dma.h>
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index 972465840548..27af35bd6a79 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -46,9 +46,9 @@
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
-#include <asm/mach/irq.h>
 #include <asm/tlbflush.h>
 
 #include "ecard.h"
diff --git a/arch/arm/mach-rpc/include/mach/irqs.h b/arch/arm/mach-rpc/include/mach/irqs.h
index 0c3428fd9729..738a9457c473 100644
--- a/arch/arm/mach-rpc/include/mach/irqs.h
+++ b/arch/arm/mach-rpc/include/mach/irqs.h
@@ -39,4 +39,4 @@
  */
 #define FIQ_START		64
 
-#define NR_IRQS			128
+#define RPC_NR_IRQS		128
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
index 649d81874c86..5e3414fc3657 100644
--- a/arch/arm/mach-rpc/irq.c
+++ b/arch/arm/mach-rpc/irq.c
@@ -5,6 +5,7 @@
 
 #include <asm/mach/irq.h>
 #include <mach/iomd.h>
+#include <mach/irqs.h>
 #include <asm/irq.h>
 #include <asm/fiq.h>
 
@@ -177,7 +178,7 @@ void __init rpc_init_irq(void)
 
 	set_handle_irq(iomd_handle_irq);
 
-	for (irq = 0; irq < NR_IRQS; irq++) {
+	for (irq = 0; irq < RPC_NR_IRQS; irq++) {
 		clr = IRQ_NOREQUEST;
 		set = 0;
 
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index d068f5e4873d..bdad13226c6d 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -23,6 +23,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <mach/iomd.h>
+#include <mach/irqs.h>
 #include <asm/page.h>
 #include <asm/domain.h>
 #include <asm/setup.h>
@@ -219,6 +220,7 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
 	.reserve_lp0	= 1,
 	.reserve_lp1	= 1,
 	.map_io		= rpc_map_io,
+	.nr_irqs	= RPC_NR_IRQS,
 	.init_irq	= rpc_init_irq,
 	.init_time	= ioc_timer_init,
 	.restart	= rpc_restart,
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index 566113f9774f..02f0fd58c7da 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -18,6 +18,7 @@
 
 #include <mach/hardware.h>
 #include <mach/iomd.h>
+#include <mach/irqs.h>
 
 #include <asm/mach/time.h>
 
diff --git a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c
index 475c3ca22fd4..cead12069319 100644
--- a/drivers/input/mouse/rpcmouse.c
+++ b/drivers/input/mouse/rpcmouse.c
@@ -22,8 +22,8 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/irq.h>
 #include <mach/iomd.h>
+#include <mach/irqs.h>
 
 MODULE_AUTHOR("Vojtech Pavlik, Russell King");
 MODULE_DESCRIPTION("Acorn RiscPC mouse driver");
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index e452ad07e2fa..7bcaed28c7a4 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -18,6 +18,7 @@
 
 #include <mach/hardware.h>
 #include <mach/iomd.h>
+#include <mach/irqs.h>
 
 MODULE_AUTHOR("Vojtech Pavlik, Russell King");
 MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
-- 
2.43.0



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

* Re: [PATCH] ARM: riscpc: convert to sparse IRQs
  2026-05-10  3:46 [PATCH] ARM: riscpc: convert to sparse IRQs Ethan Nelson-Moore
@ 2026-05-10  3:55 ` Ethan Nelson-Moore
  0 siblings, 0 replies; 2+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-10  3:55 UTC (permalink / raw)
  To: linux-arm-kernel, linux-input
  Cc: Russell King, Dmitry Torokhov, Russell King (Oracle),
	Arnd Bergmann, Linus Walleij, Kees Cook, Nathan Chancellor,
	Steven Rostedt, Thomas Weissschuh, Sebastian Andrzej Siewior,
	Peter Zijlstra

On Sat, May 9, 2026 at 8:47 PM Ethan Nelson-Moore
<enelsonmoore@gmail.com> wrote:
> This commit depends on my previous submission "ARM: <asm/floppy.h>: fix
> build with sparse IRQs".

It also depends on these commits, which I neglected to mention,
because it modifies the same sections of code:
ARM: riscpc: use iomd.h everywhere and remove redundant ioc.h header
ARM: move Risc PC-specific <asm/hardware/iomd.h> header into mach-rpc


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

end of thread, other threads:[~2026-05-10  3:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10  3:46 [PATCH] ARM: riscpc: convert to sparse IRQs Ethan Nelson-Moore
2026-05-10  3:55 ` Ethan Nelson-Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox