From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Linus Walleij <linusw@kernel.org>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH v2] pinctrl: renesas: rzt2h: fix invalid wait context
Date: Thu, 5 Feb 2026 13:04:33 +0100 [thread overview]
Message-ID: <20260205120433.iKQIknOA@linutronix.de> (raw)
In-Reply-To: <20260205103930.666051-1-cosmin-gabriel.tanislav.xa@renesas.com>
On 2026-02-05 12:39:30 [+0200], Cosmin Tanislav wrote:
> The rzt2h_gpio_get_direction() function is called from
> gpiod_get_direction(), which ends up being used within the __setup_irq()
> call stack when requesting an interrupt.
>
> __setup_irq() holds a raw_spinlock_t with IRQs disabled, which creates
> an atomic context. spinlock_t cannot be used within atomic context
> when PREEMPT_RT is enabled, since it may become a sleeping lock.
>
> An "[ BUG: Invalid wait context ]" splat is observed when running with
> CONFIG_PROVE_LOCKING enabled, describing exactly the aforementioned call
> stack.
>
> __setup_irq() needs to hold a raw_spinlock_t with IRQs disabled to
> serialize access against a concurrent hard interrupt.
>
> Switch to raw_spinlock_t to fix this.
I don't like the reasoning here because it looks like "lockdep
complained lets switch the locks and everything is fine now".
It is required to make the suggested change because the lock is used
in hardirq context and only while accessing the HW's register.
I just don't want that a lockdep splat becomes a green card for these
kind of changes without understanding the consequences.
> Fixes: 829dde3369a9 ("pinctrl: renesas: rzt2h: Add GPIO IRQ chip to handle interrupts")
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Sebastian
next prev parent reply other threads:[~2026-02-05 12:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 10:39 [PATCH v2] pinctrl: renesas: rzt2h: fix invalid wait context Cosmin Tanislav
2026-02-05 12:04 ` Sebastian Andrzej Siewior [this message]
2026-02-05 14:30 ` Cosmin-Gabriel Tanislav
2026-02-05 16:00 ` Sebastian Andrzej Siewior
2026-02-16 22:36 ` Linus Walleij
2026-03-03 13:49 ` Geert Uytterhoeven
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=20260205120433.iKQIknOA@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=brgl@kernel.org \
--cc=clrkwllms@kernel.org \
--cc=cosmin-gabriel.tanislav.xa@renesas.com \
--cc=geert+renesas@glider.be \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox