From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH] soc: renesas: mfis: add hwspinlock support
Date: Fri, 19 Jun 2026 09:06:18 +0200 [thread overview]
Message-ID: <ajTqarh55OZgSBsI@shikoro> (raw)
In-Reply-To: <20260618164905.18547-1-wsa+renesas@sang-engineering.com>
[-- Attachment #1: Type: text/plain, Size: 972 bytes --]
> [Severity: High]
> Will this sleep in atomic context on preempt-rt kernels?
>
> The hwspinlock core can invoke unlock callbacks from raw atomic contexts
> (for example, via hwspin_unlock_in_atomic). However, this callback invokes
> mfis_write(), which acquires the unprotect_lock:
>
> mfis_write()
> spin_lock_irqsave(&priv->unprotect_lock, flags);
>
> On preempt-rt builds, a spinlock_t becomes a preemptible, sleepable rt_mutex.
> Acquiring it inside an atomic context could lead to a sleeping in atomic
> regression. On standard kernels, it also violates the lockdep wait-type
> hierarchy since we are nesting a spinlock inside a raw atomic context.
>
> Should unprotect_lock be converted to a raw_spinlock_t to avoid this
> regression?
The spinlock was a best effort thing at the time. It should be a
hwspinlock even to protect against accesses from non-AP cores. I thought
this could be postponed to later, but it seems it cannot.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-06-19 7:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 16:46 [PATCH] soc: renesas: mfis: add hwspinlock support Wolfram Sang
2026-06-19 7:06 ` Wolfram Sang [this message]
2026-07-18 18:23 ` Wolfram Sang
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=ajTqarh55OZgSBsI@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=geert+renesas@glider.be \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
/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.