From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-devel@lists.linux.dev, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-remoteproc@vger.kernel.org,
Bjorn Andersson <andersson@kernel.org>,
Clark Williams <clrkwllms@kernel.org>,
Fabio Estevam <festevam@gmail.com>, Frank Li <Frank.Li@nxp.com>,
Jassi Brar <jassisinghbrar@gmail.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 0/5] mailbox: imx: Use threaded handler to avoid kworker in imx's remoteproc
Date: Tue, 2 Jun 2026 10:51:53 -0600 [thread overview]
Message-ID: <ah8KKVmE5qCGJ1cs@p14s> (raw)
In-Reply-To: <20260529-imx_mbox_rproc-v1-0-b8ffc36e11e5@linutronix.de>
On Fri, May 29, 2026 at 06:01:02PM +0200, Sebastian Andrzej Siewior wrote:
> The imx's remoteproc driver uses a kworker from its mailbox callback to
> complete the request. The reason is that the imx mailbox driver invokes
> the callback from its interrupt handler and the remoteproc callback (at
> least the rpmsg-tty) requires a preemptible context.
>
> This works but is problematic in a PREEMPT_RT environment where the
> latency of the invocation is important. By scheduling a kworker the
> high task priority from the threaded handler is lost and the kworker
> competes for CPU ressources with every SCHED_OTHER task in the system.
> This can lead to long delays on a busy system with other RT threads
> which are less important than the completion of this request.
>
> Looking over other mailbox driver, like the arm_mhu for instance, they
> use a threaded interrupt handler to invoke the callback. This avoids the
> kworker detour.
>
> The here suggested change utilises a threaded interrupt to invoke the
> callback. The primary handler mask the interrupt source so that the
> handler can run without getting interrupted by the interrupt again.
> Doing so avoids marking the interrupt IRQF_ONESHOT so that that in a
> shared-interrupt environment the other interrupt can still fire while
> the first one is masked.
>
> This change was tested on a im93 board with rpmsg-tty driver.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> Sebastian Andrzej Siewior (5):
> mailbox: imx: Start splitting the IRQ handler in primary and threaded handler
> mailbox: imx: Move the RX part of the mailbox into the threaded handler
> mailbox: imx: Move the RXDB part of the mailbox into the threaded handler
> mailbox: imx: Don't force-thread the primary handler
> remoteproc: imx_rproc: Invoke the callback directly
>
> drivers/mailbox/imx-mailbox.c | 65 +++++++++++++++++++++++++++++++++---------
> drivers/remoteproc/imx_rproc.c | 33 +--------------------
For imx_rproc.c:
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
You may also want to fix driver/remoteproc/stm32_rproc.c
> 2 files changed, 53 insertions(+), 45 deletions(-)
> ---
> base-commit: 9e171fc1d7d7ab847a750c03571c87ac3c17bd84
> change-id: 20260529-imx_mbox_rproc-7d512f5a6f78
>
> Best regards,
> --
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
prev parent reply other threads:[~2026-06-02 16:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 16:01 [PATCH 0/5] mailbox: imx: Use threaded handler to avoid kworker in imx's remoteproc Sebastian Andrzej Siewior
2026-05-29 16:01 ` [PATCH 1/5] mailbox: imx: Start splitting the IRQ handler in primary and threaded handler Sebastian Andrzej Siewior
2026-05-29 16:01 ` [PATCH 2/5] mailbox: imx: Move the RX part of the mailbox into the " Sebastian Andrzej Siewior
2026-05-29 16:01 ` [PATCH 3/5] mailbox: imx: Move the RXDB " Sebastian Andrzej Siewior
2026-05-29 16:01 ` [PATCH 4/5] mailbox: imx: Don't force-thread the primary handler Sebastian Andrzej Siewior
2026-05-29 16:01 ` [PATCH 5/5] remoteproc: imx_rproc: Invoke the callback directly Sebastian Andrzej Siewior
2026-06-02 16:51 ` Mathieu Poirier [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=ah8KKVmE5qCGJ1cs@p14s \
--to=mathieu.poirier@linaro.org \
--cc=Frank.Li@nxp.com \
--cc=andersson@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jassisinghbrar@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=s.hauer@pengutronix.de \
/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