[RFC] sh: dreamcast: Handle virq offset in cascaded IRQ demux

Message ID 7d0cb246c9f1cd24bb1f637ec5cb67e799a4c3b8.1688908227.git.geert+renesas@glider.be
State New
Headers
Series [RFC] sh: dreamcast: Handle virq offset in cascaded IRQ demux |

Commit Message

Geert Uytterhoeven July 9, 2023, 1:10 p.m. UTC
  Take into account the virq offset when translating cascaded interrupts.

Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 arch/sh/boards/mach-dreamcast/irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

John Paul Adrian Glaubitz July 12, 2023, 5:17 a.m. UTC | #1
On Sun, 2023-07-09 at 15:10 +0200, Geert Uytterhoeven wrote:
> Take into account the virq offset when translating cascaded interrupts.
> 
> Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Compile-tested only.
> ---
>  arch/sh/boards/mach-dreamcast/irq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
> index cc06e4cdb4cdf9b7..4e5fb59481a26747 100644
> --- a/arch/sh/boards/mach-dreamcast/irq.c
> +++ b/arch/sh/boards/mach-dreamcast/irq.c
> @@ -108,13 +108,13 @@ int systemasic_irq_demux(int irq)
>  	__u32 j, bit;
>  
>  	switch (irq) {
> -	case 13:
> +	case 16 + 13:
>  		level = 0;
>  		break;
> -	case 11:
> +	case 16 + 11:
>  		level = 1;
>  		break;
> -	case  9:
> +	case 16 + 9:
>  		level = 2;
>  		break;
>  	default:

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  
John Paul Adrian Glaubitz July 13, 2023, 6:56 a.m. UTC | #2
On Sun, 2023-07-09 at 15:10 +0200, Geert Uytterhoeven wrote:
> Take into account the virq offset when translating cascaded interrupts.
> 
> Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Compile-tested only.
> ---
>  arch/sh/boards/mach-dreamcast/irq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
> index cc06e4cdb4cdf9b7..4e5fb59481a26747 100644
> --- a/arch/sh/boards/mach-dreamcast/irq.c
> +++ b/arch/sh/boards/mach-dreamcast/irq.c
> @@ -108,13 +108,13 @@ int systemasic_irq_demux(int irq)
>  	__u32 j, bit;
>  
>  	switch (irq) {
> -	case 13:
> +	case 16 + 13:
>  		level = 0;
>  		break;
> -	case 11:
> +	case 16 + 11:
>  		level = 1;
>  		break;
> -	case  9:
> +	case 16 + 9:
>  		level = 2;
>  		break;
>  	default:

Applied to my for-linus branch.

Thanks,
Adrian
  

Patch

diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
index cc06e4cdb4cdf9b7..4e5fb59481a26747 100644
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ b/arch/sh/boards/mach-dreamcast/irq.c
@@ -108,13 +108,13 @@  int systemasic_irq_demux(int irq)
 	__u32 j, bit;
 
 	switch (irq) {
-	case 13:
+	case 16 + 13:
 		level = 0;
 		break;
-	case 11:
+	case 16 + 11:
 		level = 1;
 		break;
-	case  9:
+	case 16 + 9:
 		level = 2;
 		break;
 	default: