Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org
Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Linus Walleij <linusw@kernel.org>,
	Kees Cook <kees@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Weissschuh <thomas.weissschuh@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH] ARM: riscpc: convert to sparse IRQs
Date: Sat,  9 May 2026 20:46:38 -0700	[thread overview]
Message-ID: <20260510034652.349166-1-enelsonmoore@gmail.com> (raw)

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



             reply	other threads:[~2026-05-10  3:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10  3:46 Ethan Nelson-Moore [this message]
2026-05-10  3:55 ` [PATCH] ARM: riscpc: convert to sparse IRQs Ethan Nelson-Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260510034652.349166-1-enelsonmoore@gmail.com \
    --to=enelsonmoore@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kees@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nathan@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=rostedt@goodmis.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox