From: sashiko-bot@kernel.org
To: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v2 7/9] mailbox: imx: Move the RXDB part of the mailbox into the threaded handler
Date: Wed, 03 Jun 2026 14:19:47 +0000 [thread overview]
Message-ID: <20260603141947.65CD01F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260603-imx_mbox_rproc-v2-7-a0059dc3b69a@linutronix.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Error paths in `imx_mu_seco_rxdb` fail to clear the hardware interrupt status (`GIPn`), leading to an infinite IRQ storm because the threaded handler unconditionally unmasks the interrupt.
--
commit fc70fc114c374d42412c37d5886dc2cfe0a507bb
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: mailbox: imx: Move the RXDB part of the mailbox into the threaded handler
This commit moves the RXDB callback handling from the hardirq to the threaded
interrupt handler. It also changes the behavior to unconditionally unmask
the RXDB interrupt after the callback returns.
> diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
> --- a/drivers/mailbox/imx-mailbox.c
> +++ b/drivers/mailbox/imx-mailbox.c
[ ... ]
> @@ -559,6 +559,12 @@ static irqreturn_t imx_mu_isr_th(int irq, void *p)
> imx_mu_xcr_set_act(priv, cp, IMX_MU_RCR, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx));
> break;
>
> + case IMX_MU_TYPE_RXDB:
> + cp->pending = false;
> + priv->dcfg->rxdb(priv, cp);
> + imx_mu_xcr_set_act(priv, cp, IMX_MU_GIER, IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx));
[Severity: High]
This is a pre-existing issue, but since this handler now unconditionally
unmasks the interrupt, could this lead to an infinite interrupt storm if an
error occurs in the callback?
Looking at imx_mu_seco_rxdb(), if the received message size is invalid or a
read timeout occurs, the function jumps to the error path:
drivers/mailbox/imx-mailbox.c:imx_mu_seco_rxdb() {
...
goto error;
...
error:
mbox_chan_received_data(cp->chan, ERR_PTR(err));
exit:
return err;
}
This error path skips writing to the GSR register to clear the GIPn hardware
interrupt pending bit. Since imx_mu_isr_th() ignores the return value of
rxdb() and unconditionally unmasks the interrupt via imx_mu_xcr_set_act(),
won't the uncleared hardware status bit immediately re-trigger the hardirq
and cause a livelock?
> + break;
> +
> default:
> dev_warn_ratelimited(priv->dev, "Unhandled channel type %d\n",
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260603-imx_mbox_rproc-v2-0-a0059dc3b69a@linutronix.de?part=7
next prev parent reply other threads:[~2026-06-03 14:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 13:05 [PATCH v2 0/9] mailbox: imx: Use threaded handler to avoid kworker in imx's remoteproc Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 1/9] mailbox: imx: Add a channel shutdown field Sebastian Andrzej Siewior
2026-06-03 13:20 ` sashiko-bot
2026-06-03 14:59 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 2/9] mailbox: imx: Use devm_pm_runtime_enable() Sebastian Andrzej Siewior
2026-06-03 13:27 ` sashiko-bot
2026-06-03 15:00 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 3/9] mailbox: imx: use devm_of_platform_populate() Sebastian Andrzej Siewior
2026-06-03 13:37 ` sashiko-bot
2026-06-03 15:01 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 4/9] mailbox: imx: Use channel index instead of zero in imx_mu_specific_rx() Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 5/9] mailbox: imx: Start splitting the IRQ handler in primary and threaded handler Sebastian Andrzej Siewior
2026-06-03 13:58 ` sashiko-bot
2026-06-03 15:07 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 6/9] mailbox: imx: Move the RX part of the mailbox into the " Sebastian Andrzej Siewior
2026-06-03 13:18 ` Daniel Baluta
2026-06-03 13:20 ` Sebastian Andrzej Siewior
2026-06-03 13:45 ` Daniel Baluta
2026-06-03 15:26 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 7/9] mailbox: imx: Move the RXDB " Sebastian Andrzej Siewior
2026-06-03 14:19 ` sashiko-bot [this message]
2026-06-03 13:05 ` [PATCH v2 8/9] mailbox: imx: Don't force-thread the primary handler Sebastian Andrzej Siewior
2026-06-03 14:31 ` sashiko-bot
2026-06-03 15:20 ` Sebastian Andrzej Siewior
2026-06-03 13:05 ` [PATCH v2 9/9] remoteproc: imx_rproc: Invoke the callback directly Sebastian Andrzej Siewior
2026-06-03 14:45 ` sashiko-bot
2026-06-03 15:21 ` Sebastian Andrzej Siewior
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=20260603141947.65CD01F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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.