mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Graeme Harker <graeme.harker@gmail.com>
To: geert@linux-m68k.org
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	tsbogend@alpha.franken.de,
	Graeme Harker <graeme.harker@gmail.com>
Subject: [PATCH] m68k: irq: Fix irq numbering in m68k_setup_user_interrupt()
Date: Fri, 13 Nov 2026 14:37:31 +0000	[thread overview]
Message-ID: <20261113143731.167962-1-graeme.harker@gmail.com> (raw)

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


                 reply	other threads:[~2026-11-13 14:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261113143731.167962-1-graeme.harker@gmail.com \
    --to=graeme.harker@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=tsbogend@alpha.franken.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

all inboxes | Powered by JetHome®