mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [RFT] sh: mach-r2d: Handle virq offset in cascaded IRL demux
@ 2023-07-09 11:15 Geert Uytterhoeven
  2023-07-09 11:52 ` John Paul Adrian Glaubitz
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2023-07-09 11:15 UTC (permalink / raw)
  To: Guenter Roeck, Sergey Shtylyov, John Paul Adrian Glaubitz,
	Yoshinori Sato, Rich Felker
  Cc: linux-sh, linux-kernel, Geert Uytterhoeven

When booting rts7751r2dplus_defconfig on QEMU, the system hangs due to
an interrupt storm on IRQ 20.  IRQ 20 aka event 0x280 is a cascaded IRL
interrupt, which maps to IRQ_VOYAGER, the interrupt used by the Silicon
Motion SM501 multimedia companion chip.  As rts7751r2d_irq_demux() does
not take into account the new virq offset, the interrupt is no longer
translated, leading to an unhandled interrupt.

Fix this by taking into account the virq offset when translating
cascaded IRL interrupts.

Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/r/fbfea3ad-d327-4ad5-ac9c-648c7ca3fe1f@roeck-us.net
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Highlander and Dreamcast probably have the same issue.
I'll send patches for these later...
---
 arch/sh/boards/mach-r2d/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
index e34f81e9ae813b8d..c37b40398c5bc83e 100644
--- a/arch/sh/boards/mach-r2d/irq.c
+++ b/arch/sh/boards/mach-r2d/irq.c
@@ -117,10 +117,10 @@ static unsigned char irl2irq[R2D_NR_IRL];
 
 int rts7751r2d_irq_demux(int irq)
 {
-	if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
+	if (irq >= 16 + R2D_NR_IRL || irq < 16 || !irl2irq[irq - 16])
 		return irq;
 
-	return irl2irq[irq];
+	return irl2irq[irq - 16];
 }
 
 /*
-- 
2.34.1


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

end of thread, other threads:[~2023-07-13  6:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 11:15 [PATCH] [RFT] sh: mach-r2d: Handle virq offset in cascaded IRL demux Geert Uytterhoeven
2023-07-09 11:52 ` John Paul Adrian Glaubitz
2023-07-09 11:53 ` John Paul Adrian Glaubitz
2023-07-09 11:58 ` John Paul Adrian Glaubitz
2023-07-09 12:50   ` Sergey Shtylyov
2023-07-09 13:51 ` Guenter Roeck
2023-07-10  1:13 ` Guenter Roeck
2023-07-10  7:03   ` Geert Uytterhoeven
2023-07-10  7:44     ` John Paul Adrian Glaubitz
2023-07-10  7:54       ` Geert Uytterhoeven
2023-07-10  7:57         ` John Paul Adrian Glaubitz
2023-07-10  8:18           ` Geert Uytterhoeven
2023-07-10  8:20             ` John Paul Adrian Glaubitz
2023-07-10  8:25               ` Geert Uytterhoeven
2023-07-10  7:23   ` John Paul Adrian Glaubitz
2023-07-13  6:54 ` John Paul Adrian Glaubitz

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®