lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXescaJ-V0iuXsxo=X-7RYTBR1W5+EXZCw_2VPHEFGzdA@mail.gmail.com>
Date: Thu, 18 Apr 2024 16:07:14 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: linus.walleij@...aro.org, tglx@...utronix.de, biju.das.jz@...renesas.com, 
	linux-renesas-soc@...r.kernel.org, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, 
	Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v3 2/2] pinctrl: renesas: rzg2l: Configure the interrupt
 type on resume

Hi Claudiu,

On Wed, Mar 20, 2024 at 11:43 AM Claudiu <claudiu.beznea@...on.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>
> Commit dce0919c83c3 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT
> source at the same time") removed the setup of TINT from
> rzg2l_irqc_irq_enable(). To address the spourious interrupt issue the setup
> of TINT has been moved in rzg2l_tint_set_edge() though
> rzg2l_disable_tint_and_set_tint_source(). With this, the interrupts are
> not properly re-configured after a suspend-to-RAM cycle. To address
> this issue and avoid spurious interrupts while resumming set the
> interrupt type before enabling it.
>
> Fixes: dce0919c83c3 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>

Thanks for your patch!

> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> @@ -2045,7 +2045,9 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
>
>         for (unsigned int i = 0; i < RZG2L_TINT_MAX_INTERRUPT; i++) {
>                 struct irq_data *data;
> +               unsigned long flags;
>                 unsigned int virq;
> +               int ret;
>
>                 if (!pctrl->hwirq[i])
>                         continue;
> @@ -2063,17 +2065,17 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
>                         continue;
>                 }
>
> -               if (!irqd_irq_disabled(data)) {
> -                       unsigned long flags;
> -
> -                       /*
> -                        * This has to be atomically executed to protect against a concurrent
> -                        * interrupt.
> -                        */
> -                       raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
> +               /*
> +                * This has to be atomically executed to protect against a concurrent
> +                * interrupt.
> +                */
> +               raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
> +               ret = rzg2l_gpio_irq_set_type(data, irqd_get_trigger_type(data));
> +               if (ret)
> +                       dev_crit(pctrl->dev, "Failed to set IRQ type for virq=%u\n", virq);
> +               else if (!irqd_irq_disabled(data))
>                         rzg2l_gpio_irq_enable(data);
> -                       raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
> -               }
> +               raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
>         }
>  }

LGTM, but I'd rather move the dev_crit() outside (i.e. after) the
critical section.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68korg

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ