diff mbox series

[v1,1/3] gpio: ep93xx: Fix port F hwirq numbers in handler

Message ID 20230125083026.5399-2-nikita.shubin@maquefel.me
State New
Headers show
Series [v1,1/3] gpio: ep93xx: Fix port F hwirq numbers in handler | expand

Commit Message

Nikita Shubin Jan. 25, 2023, 8:30 a.m. UTC
Fix wrong translation of irq numbers in port F handler, as ep93xx hwirqs
increased by 1, we should simply decrease them by 1 in translation.

Fixes: 482c27273f52 ("ARM: ep93xx: renumber interrupts")
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 drivers/gpio/gpio-ep93xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Jan. 25, 2023, 9:39 a.m. UTC | #1
On Wed, Jan 25, 2023, at 09:30, Nikita Shubin wrote:
> Fix wrong translation of irq numbers in port F handler, as ep93xx hwirqs
> increased by 1, we should simply decrease them by 1 in translation.
>
> Fixes: 482c27273f52 ("ARM: ep93xx: renumber interrupts")
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Cc: stable@vger.kernel.org # v5.19+
Acked-by: Arnd Bergmann <arnd@arndb.de>


> ---
>  drivers/gpio/gpio-ep93xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index 2e1779709113..7edcdc575080 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -148,7 +148,7 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
>  	 */
>  	struct irq_chip *irqchip = irq_desc_get_chip(desc);
>  	unsigned int irq = irq_desc_get_irq(desc);
> -	int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
> +	int port_f_idx = (irq & 7) ^ 4; /* {20..23,48..51} -> {0..7} */
>  	int gpio_irq = EP93XX_GPIO_F_IRQ_BASE + port_f_idx;
> 
>  	chained_irq_enter(irqchip, desc);
> -- 
> 2.37.4
Bartosz Golaszewski Jan. 25, 2023, 12:42 p.m. UTC | #2
On Wed, Jan 25, 2023 at 9:30 AM Nikita Shubin <nikita.shubin@maquefel.me> wrote:
>
> Fix wrong translation of irq numbers in port F handler, as ep93xx hwirqs
> increased by 1, we should simply decrease them by 1 in translation.
>
> Fixes: 482c27273f52 ("ARM: ep93xx: renumber interrupts")
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
>  drivers/gpio/gpio-ep93xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index 2e1779709113..7edcdc575080 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -148,7 +148,7 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
>          */
>         struct irq_chip *irqchip = irq_desc_get_chip(desc);
>         unsigned int irq = irq_desc_get_irq(desc);
> -       int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
> +       int port_f_idx = (irq & 7) ^ 4; /* {20..23,48..51} -> {0..7} */
>         int gpio_irq = EP93XX_GPIO_F_IRQ_BASE + port_f_idx;
>
>         chained_irq_enter(irqchip, desc);
> --
> 2.37.4
>

Queued for fixes, thanks!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index 2e1779709113..7edcdc575080 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -148,7 +148,7 @@  static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
 	 */
 	struct irq_chip *irqchip = irq_desc_get_chip(desc);
 	unsigned int irq = irq_desc_get_irq(desc);
-	int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
+	int port_f_idx = (irq & 7) ^ 4; /* {20..23,48..51} -> {0..7} */
 	int gpio_irq = EP93XX_GPIO_F_IRQ_BASE + port_f_idx;
 
 	chained_irq_enter(irqchip, desc);