2023-07-09 13:25:24

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH] [RFC] sh: highlander: Handle virq offset in cascaded IRL demux

Take into account the virq offset when translating cascaded IRL
interrupts.

Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
Compile-tested only, but the fix is identical to the fix for rts7751r2d.
---
arch/sh/boards/mach-highlander/setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 533393d779c2b97f..a821a1b155473d93 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -389,10 +389,10 @@ static unsigned char irl2irq[HL_NR_IRL];

static int highlander_irq_demux(int irq)
{
- if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq])
+ if (irq >= 16 + HL_NR_IRL || irq < 16 || !irl2irq[irq - 16])
return irq;

- return irl2irq[irq];
+ return irl2irq[irq - 16];
}

static void __init highlander_init_irq(void)
--
2.34.1



Subject: Re: [PATCH] [RFC] sh: highlander: Handle virq offset in cascaded IRL demux

On Sun, 2023-07-09 at 15:10 +0200, Geert Uytterhoeven wrote:
> Take into account the virq offset when translating cascaded IRL
> interrupts.
>
> Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> Compile-tested only, but the fix is identical to the fix for rts7751r2d.
> ---
> arch/sh/boards/mach-highlander/setup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
> index 533393d779c2b97f..a821a1b155473d93 100644
> --- a/arch/sh/boards/mach-highlander/setup.c
> +++ b/arch/sh/boards/mach-highlander/setup.c
> @@ -389,10 +389,10 @@ static unsigned char irl2irq[HL_NR_IRL];
>
> static int highlander_irq_demux(int irq)
> {
> - if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq])
> + if (irq >= 16 + HL_NR_IRL || irq < 16 || !irl2irq[irq - 16])
> return irq;
>
> - return irl2irq[irq];
> + return irl2irq[irq - 16];
> }
>
> static void __init highlander_init_irq(void)

Reviewed-by: John Paul Adrian Glaubitz <[email protected]>

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Subject: Re: [PATCH] [RFC] sh: highlander: Handle virq offset in cascaded IRL demux

On Sun, 2023-07-09 at 15:10 +0200, Geert Uytterhoeven wrote:
> Take into account the virq offset when translating cascaded IRL
> interrupts.
>
> Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> Compile-tested only, but the fix is identical to the fix for rts7751r2d.
> ---
> arch/sh/boards/mach-highlander/setup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
> index 533393d779c2b97f..a821a1b155473d93 100644
> --- a/arch/sh/boards/mach-highlander/setup.c
> +++ b/arch/sh/boards/mach-highlander/setup.c
> @@ -389,10 +389,10 @@ static unsigned char irl2irq[HL_NR_IRL];
>
> static int highlander_irq_demux(int irq)
> {
> - if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq])
> + if (irq >= 16 + HL_NR_IRL || irq < 16 || !irl2irq[irq - 16])
> return irq;
>
> - return irl2irq[irq];
> + return irl2irq[irq - 16];
> }
>
> static void __init highlander_init_irq(void)

Applied to my for-linus branch.

Thanks,
Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Subject: Re: [PATCH] [RFC] sh: highlander: Handle virq offset in cascaded IRL demux

On Sun, 2023-07-09 at 15:10 +0200, Geert Uytterhoeven wrote:
> Take into account the virq offset when translating cascaded IRL
> interrupts.
>
> Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4")
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> Compile-tested only, but the fix is identical to the fix for rts7751r2d.
> ---
> arch/sh/boards/mach-highlander/setup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
> index 533393d779c2b97f..a821a1b155473d93 100644
> --- a/arch/sh/boards/mach-highlander/setup.c
> +++ b/arch/sh/boards/mach-highlander/setup.c
> @@ -389,10 +389,10 @@ static unsigned char irl2irq[HL_NR_IRL];
>
> static int highlander_irq_demux(int irq)
> {
> - if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq])
> + if (irq >= 16 + HL_NR_IRL || irq < 16 || !irl2irq[irq - 16])
> return irq;
>
> - return irl2irq[irq];
> + return irl2irq[irq - 16];
> }
>
> static void __init highlander_init_irq(void)

Applied to my for-linus branch.

Thanks,
Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913