Skip to content

Commit fe7daa3

Browse files
geertugregkh
authored andcommitted
sh: mach-r2d: Handle virq offset in cascaded IRL demux
commit ab8aa4f upstream. 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: a8ac296 ("sh: Avoid using IRQ0 on SH3 and SH4") Reported-by: Guenter Roeck <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Tested-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 899cc8f commit fe7daa3

File tree

1 file changed

+2
-2
lines changed
  • arch/sh/boards/mach-r2d

1 file changed

+2
-2
lines changed

arch/sh/boards/mach-r2d/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ static unsigned char irl2irq[R2D_NR_IRL];
117117

118118
int rts7751r2d_irq_demux(int irq)
119119
{
120-
if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
120+
if (irq >= R2D_NR_IRL + 16 || irq < 16 || !irl2irq[irq - 16])
121121
return irq;
122122

123-
return irl2irq[irq];
123+
return irl2irq[irq - 16];
124124
}
125125

126126
/*

0 commit comments

Comments
 (0)