All of lore.kernel.org
 help / color / mirror / Atom feed
From: Diederik de Haas <didi.debian@cknow.org>
To: geert+renesas@glider.be, linus.walleij@linaro.org, efault@gmx.de,
	Claudiu <claudiu.beznea@tuxon.dev>
Cc: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev,
	linux-rt-users@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH] pinctrl: renesas: rzg2l: use spin_{lock,unlock}_irq{save,restore}
Date: Tue, 21 May 2024 17:08:04 +0200	[thread overview]
Message-ID: <1909974.d4bNfQZPDi@bagend> (raw)
In-Reply-To: <20240520072033.228049-1-claudiu.beznea.uj@bp.renesas.com>

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]

On Monday, 20 May 2024 09:20:33 CEST Claudiu 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: e1fd1f9f457b ("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>
> ---
>  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);

Now the build succeeds on both amd64 and arm64.
Thanks!

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      parent reply	other threads:[~2024-05-21 15:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20  7:20 [PATCH] pinctrl: renesas: rzg2l: use spin_{lock,unlock}_irq{save,restore} Claudiu
2024-05-21 14:22 ` Sebastian Andrzej Siewior
2024-05-21 15:08 ` Diederik de Haas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1909974.d4bNfQZPDi@bagend \
    --to=didi.debian@cknow.org \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=efault@gmx.de \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.