* [PATCH] m68k: irq: Fix irq numbering in m68k_setup_user_interrupt()
@ 2026-11-13 14:37 Graeme Harker
0 siblings, 0 replies; only message in thread
From: Graeme Harker @ 2026-11-13 14:37 UTC (permalink / raw)
To: geert; +Cc: linux-m68k, linux-kernel, tsbogend, Graeme Harker
m68k_setup_user_interrupt() is meant to set up the user vector
interrupts IRQ_USER to IRQ_USER + cnt - 1, as its BUG_ON() check
assumes. Since the change to irq_set_chip_and_handler(), however, it
sets up interrupts 0 to cnt - 1 instead, having lost the IRQ_USER
offset on the way.
The VME boards pass a count of 192, so the user vector interrupts they
use are still covered. Sun-3 passes 128 but requests IRQ_USER + 127,
interrupt 135, which has been left without a chip, so its vec255
handler has failed to register ever since. All of them have also had
user_irq_chip put on the autovector interrupts 1 to 7. A machine with
only a few user vectors, such as one with a single vectored interrupt
source and cnt = 1, is left with its interrupt on handle_bad_irq().
Restore the offset. Only tested on a machine that calls this with
cnt = 1; the VME, Sun-3, Atari and Apollo callers have not been
tested.
Fixes: 378f7ca6aa22 ("m68k/irq: Vector ints need a valid interrupt handler")
Signed-off-by: Graeme Harker <graeme.harker@gmail.com>
Assisted-by: Claude:claude-opus-5.5
---
The machine with cnt = 1 is a homebrew 68030 board whose support is
not upstream: one vectored interrupt source (a 68681 DUART, vector 64),
which stayed on handle_bad_irq() until this change.
The Sun-3 statement is from reading the code, not from running it:
sun3_init_IRQ() passes 128, so interrupts 0-127 got the chip, and then
requests IRQ_USER + 127 = 135.
Build-tested on m68k master (v7.4-rc2) with multi_defconfig,
sun3_defconfig and virt_defconfig.
arch/m68k/kernel/ints.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index cf2b13488476..eb41aace61d4 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -97,7 +97,8 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt)
BUG_ON(IRQ_USER + cnt > NR_IRQS);
m68k_first_user_vec = vec;
for (i = 0; i < cnt; i++)
- irq_set_chip_and_handler(i, &user_irq_chip, handle_simple_irq);
+ irq_set_chip_and_handler(IRQ_USER + i, &user_irq_chip,
+ handle_simple_irq);
*user_irqvec_fixup = vec - IRQ_USER;
flush_icache();
}
base-commit: 8c9ddebb300c719362a52a2d465f44e7d055778d
--
2.53.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-13 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 14:37 [PATCH] m68k: irq: Fix irq numbering in m68k_setup_user_interrupt() Graeme Harker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®