diff options
| author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2026-06-17 08:55:32 +0200 |
|---|---|---|
| committer | Jassi Brar <jassisinghbrar@gmail.com> | 2026-06-20 21:18:39 -0500 |
| commit | e55bea377d492f0fd4a7f657fc2a9247b5b96afb (patch) | |
| tree | 8654796400bac6ad405d9460b22aed153a53ffda /drivers | |
| parent | 692e1bc96a5dc7d5c43d937c2a50b56303544dea (diff) | |
| download | lwn-e55bea377d492f0fd4a7f657fc2a9247b5b96afb.tar.gz lwn-e55bea377d492f0fd4a7f657fc2a9247b5b96afb.zip | |
mailbox: imx: Move the RX part of the mailbox into the threaded handler
Move RX callback handling into the threaded handler. This is similar to
the TX side except that we explicitly mask the source interrupt in the
primary handler and unmask it in the threaded handler again after
success. This was done automatically in the TX part.
The masking/ unmasking can be removed from imx_mu_specific_rx() since it
already happens in the primary/ threaded handler before invoking the
channel specific callback.
Move RX channel handling into threaded handler.
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mailbox/imx-mailbox.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 87acc43cb99c..1219c35b116e 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -381,7 +381,6 @@ static int imx_mu_specific_rx(struct imx_mu_priv *priv, struct imx_mu_con_priv * data = (u32 *)priv->msg; - imx_mu_xcr_rmw(priv, IMX_MU_RCR, 0, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); *data++ = imx_mu_read(priv, priv->dcfg->xRR); if (priv->dcfg->type & IMX_MU_V2_S4) { @@ -408,7 +407,6 @@ static int imx_mu_specific_rx(struct imx_mu_priv *priv, struct imx_mu_con_priv * *data++ = imx_mu_read(priv, priv->dcfg->xRR + (i % num_rr) * 4); } - imx_mu_xcr_set_act(priv, cp, IMX_MU_RCR, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); mbox_chan_received_data(cp->chan, (void *)priv->msg); return 0; @@ -551,6 +549,11 @@ static irqreturn_t imx_mu_isr_th(int irq, void *p) mbox_chan_txdone(chan, 0); break; + case IMX_MU_TYPE_RX: + if (!priv->dcfg->rx(priv, cp)) + imx_mu_xcr_set_act(priv, cp, IMX_MU_RCR, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); + break; + default: dev_warn_ratelimited(priv->dev, "Unhandled channel type %d\n", cp->type); @@ -603,7 +606,8 @@ static irqreturn_t imx_mu_isr(int irq, void *p) ret = IRQ_WAKE_THREAD; } else if ((val == IMX_MU_xSR_RFn(priv->dcfg->type, cp->idx)) && (cp->type == IMX_MU_TYPE_RX)) { - priv->dcfg->rx(priv, cp); + imx_mu_xcr_rmw(priv, IMX_MU_RCR, 0, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); + ret = IRQ_WAKE_THREAD; } else if ((val == IMX_MU_xSR_GIPn(priv->dcfg->type, cp->idx)) && (cp->type == IMX_MU_TYPE_RXDB)) { priv->dcfg->rxdb(priv, cp); |
