public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
@ 2024-05-22  5:54 Claudiu
  2024-05-22  9:27 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Claudiu @ 2024-05-22  5:54 UTC (permalink / raw)
  To: geert+renesas, linus.walleij, didi.debian, efault
  Cc: linux-renesas-soc, linux-gpio, linux-kernel, claudiu.beznea,
	linux-rt-users, Claudiu Beznea

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

On PREEMPT_RT kernels the spinlock_t maps to an rtmutex. Using
raw_spin_lock_irqsave()/raw_spin_unlock_irqrestore() on
&pctrl->lock.rlock breaks the PREEMPT_RT builds. To fix this use
spin_lock_irqsave()/spin_unlock_irqrestore() on &pctrl->lock.

Fixes: 02cd2d3be1c3 ("pinctrl: renesas: rzg2l: Configure the interrupt type on resume")
Reported-by: Diederik de Haas <didi.debian@cknow.org>
Closes: https://lore.kernel.org/all/131999629.KQPSlr0Zke@bagend
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---

Changes in v2:
- use proper commit id in "Fixes" section
- s/use/Use in patch title

 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 20425afc6b33..78f947a8e26e 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -2069,11 +2069,11 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
 		 * This has to be atomically executed to protect against a concurrent
 		 * interrupt.
 		 */
-		raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
+		spin_lock_irqsave(&pctrl->lock, flags);
 		ret = rzg2l_gpio_irq_set_type(data, irqd_get_trigger_type(data));
 		if (!ret && !irqd_irq_disabled(data))
 			rzg2l_gpio_irq_enable(data);
-		raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
+		spin_unlock_irqrestore(&pctrl->lock, flags);
 
 		if (ret)
 			dev_crit(pctrl->dev, "Failed to set IRQ type for virq=%u\n", virq);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
  2024-05-22  5:54 [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore} Claudiu
@ 2024-05-22  9:27 ` Geert Uytterhoeven
  2024-06-05 11:00   ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-05-22  9:27 UTC (permalink / raw)
  To: Claudiu
  Cc: linus.walleij, didi.debian, efault, linux-renesas-soc, linux-gpio,
	linux-kernel, linux-rt-users, Claudiu Beznea

On Wed, May 22, 2024 at 7:54 AM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> On PREEMPT_RT kernels the spinlock_t maps to an rtmutex. Using
> raw_spin_lock_irqsave()/raw_spin_unlock_irqrestore() on
> &pctrl->lock.rlock breaks the PREEMPT_RT builds. To fix this use
> spin_lock_irqsave()/spin_unlock_irqrestore() on &pctrl->lock.
>
> Fixes: 02cd2d3be1c3 ("pinctrl: renesas: rzg2l: Configure the interrupt type on resume")
> Reported-by: Diederik de Haas <didi.debian@cknow.org>
> Closes: https://lore.kernel.org/all/131999629.KQPSlr0Zke@bagend
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
>
> Changes in v2:
> - use proper commit id in "Fixes" section
> - s/use/Use in patch title

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-pinctrl-fixes for v6.10.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
  2024-05-22  9:27 ` Geert Uytterhoeven
@ 2024-06-05 11:00   ` Sebastian Andrzej Siewior
  2024-06-05 11:22     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-06-05 11:00 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Claudiu, linus.walleij, didi.debian, efault, linux-renesas-soc,
	linux-gpio, linux-kernel, linux-rt-users, Claudiu Beznea

On 2024-05-22 11:27:55 [+0200], Geert Uytterhoeven wrote:
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-pinctrl-fixes for v6.10.

I picked this up for RT and see that it is not part of v6.10-rc2. I
assume that this will be applied within the v6.10 cycle once you have
more in your tree, right?

> Gr{oetje,eeting}s,
> 
>                         Geert

Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
  2024-06-05 11:00   ` Sebastian Andrzej Siewior
@ 2024-06-05 11:22     ` Geert Uytterhoeven
  2024-06-05 13:26       ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-06-05 11:22 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Claudiu, linus.walleij, didi.debian, efault, linux-renesas-soc,
	linux-gpio, linux-kernel, linux-rt-users, Claudiu Beznea

Hi Sebastian,

On Wed, Jun 5, 2024 at 1:00 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
> On 2024-05-22 11:27:55 [+0200], Geert Uytterhoeven wrote:
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > i.e. will queue in renesas-pinctrl-fixes for v6.10.
>
> I picked this up for RT and see that it is not part of v6.10-rc2. I
> assume that this will be applied within the v6.10 cycle once you have
> more in your tree, right?

I have already sent a pull request for it to LinusW, and it is now part
of pinctrl/for-next.  I assume LinusW will send a PR to Linus(T ;-)
in time later.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
  2024-06-05 11:22     ` Geert Uytterhoeven
@ 2024-06-05 13:26       ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-06-05 13:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Claudiu, linus.walleij, didi.debian, efault, linux-renesas-soc,
	linux-gpio, linux-kernel, linux-rt-users, Claudiu Beznea

On 2024-06-05 13:22:50 [+0200], Geert Uytterhoeven wrote:
> Hi Sebastian,
Hi Geert,

> I have already sent a pull request for it to LinusW, and it is now part
> of pinctrl/for-next.  I assume LinusW will send a PR to Linus(T ;-)
> in time later.

Thanks for the update.

> Gr{oetje,eeting}s,
> 
>                         Geert

Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-05 13:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  5:54 [PATCH v2] pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore} Claudiu
2024-05-22  9:27 ` Geert Uytterhoeven
2024-06-05 11:00   ` Sebastian Andrzej Siewior
2024-06-05 11:22     ` Geert Uytterhoeven
2024-06-05 13:26       ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox