* [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device
@ 2026-07-23 22:56 Vincent Jardin via B4 Relay
2026-07-30 15:39 ` Ioana Ciornei
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-07-23 22:56 UTC (permalink / raw)
To: Ioana Ciornei, Laurentiu Tudor, Greg Kroah-Hartman,
Bogdan Purcareata, Stuart Yoder
Cc: linuxppc-dev, linux-kernel, stable, Vincent Jardin
From: Vincent Jardin <vjardin@free.fr>
On Layerscape platforms, when SMMU is disabled,
fsl_mc_device_add() leads to the DPRC device with a NULL dma_mask.
It has been tested on LX2160A, no SMMU on the MC
domain: the root DPRC can probe cleanly and fsl_mc children
enumerate.
Fixes: a259ed1618d2 ("bus/fsl-mc: support dma configure for devices on fsl-mc bus")
Cc: stable@vger.kernel.org
Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
fsl_mc_device_add() already seeds a default dma_mask for non-DPRC
objects, but never for the DPRC devices themselves. When the MC I/O
domain is not behind an SMMU, the root DPRC reaches
fsl_mc_dma_configure() -> of_dma_configure_id() with a NULL dma_mask
and the probe warns "DMA mask not set". This mirrors the existing
non-DPRC seeding into the DPRC branch.
Tested on LX2160A with no SMMU on the MC domain: the root DPRC probes
cleanly and its fsl_mc children enumerate.
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 64d75eed0d34..585345ac0179 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -832,6 +832,14 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid);
if (error < 0)
goto error_cleanup_dev;
+
+ /*
+ * Seed dma_mask so platforms without an SMMU don't complain
+ * with "DMA mask not set" in of_dma_configure_id().
+ */
+ mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK;
+ mc_dev->dev.dma_mask = &mc_dev->dma_mask;
+ mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask;
} else {
/*
* A non-DPRC object has to be a child of a DPRC, use the
---
base-commit: 248951ddc14de84de3910f9b13f51491a8cd91df
change-id: 20260724-for-upstream-fsl-mc-dprc-dma-mask-a11e4c5a85c6
Best regards,
--
Vincent Jardin <vjardin@free.fr>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device
2026-07-23 22:56 [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device Vincent Jardin via B4 Relay
@ 2026-07-30 15:39 ` Ioana Ciornei
2026-07-31 18:47 ` Vincent Jardin
0 siblings, 1 reply; 3+ messages in thread
From: Ioana Ciornei @ 2026-07-30 15:39 UTC (permalink / raw)
To: vjardin
Cc: Laurentiu Tudor, Greg Kroah-Hartman, Bogdan Purcareata,
Stuart Yoder, linuxppc-dev, linux-kernel, stable
On Fri, Jul 24, 2026 at 12:56:33AM +0200, Vincent Jardin via B4 Relay wrote:
> From: Vincent Jardin <vjardin@free.fr>
>
> On Layerscape platforms, when SMMU is disabled,
> fsl_mc_device_add() leads to the DPRC device with a NULL dma_mask.
>
> It has been tested on LX2160A, no SMMU on the MC
> domain: the root DPRC can probe cleanly and fsl_mc children
> enumerate.
>
> Fixes: a259ed1618d2 ("bus/fsl-mc: support dma configure for devices on fsl-mc bus")
Is this fixing an actual bug introduced by the blamed commit or are we
talking only about the warning message?
Commit 4d8bde883bfb ("OF: Don't set default coherent DMA mask") is the
one that added the dev_warn.
> Cc: stable@vger.kernel.org
> Signed-off-by: Vincent Jardin <vjardin@free.fr>
> ---
> fsl_mc_device_add() already seeds a default dma_mask for non-DPRC
> objects, but never for the DPRC devices themselves. When the MC I/O
> domain is not behind an SMMU, the root DPRC reaches
> fsl_mc_dma_configure() -> of_dma_configure_id() with a NULL dma_mask
> and the probe warns "DMA mask not set".
> This mirrors the existing
> non-DPRC seeding into the DPRC branch.
>
> Tested on LX2160A with no SMMU on the MC domain: the root DPRC probes
> cleanly and its fsl_mc children enumerate.
> ---
> drivers/bus/fsl-mc/fsl-mc-bus.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
> index 64d75eed0d34..585345ac0179 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-bus.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
> @@ -832,6 +832,14 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
> error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid);
> if (error < 0)
> goto error_cleanup_dev;
> +
> + /*
> + * Seed dma_mask so platforms without an SMMU don't complain
> + * with "DMA mask not set" in of_dma_configure_id().
> + */
> + mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK;
> + mc_dev->dev.dma_mask = &mc_dev->dma_mask;
> + mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask;
Since as you said this is an exact mirror for the non-DPRC case, can you
move it to the common path before the if-else statement without
duplicating it?
Ioana
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device
2026-07-30 15:39 ` Ioana Ciornei
@ 2026-07-31 18:47 ` Vincent Jardin
0 siblings, 0 replies; 3+ messages in thread
From: Vincent Jardin @ 2026-07-31 18:47 UTC (permalink / raw)
To: Ioana Ciornei
Cc: Laurentiu Tudor, Greg Kroah-Hartman, Bogdan Purcareata,
Stuart Yoder, linuxppc-dev, linux-kernel, stable
Hi Ioana,
> > Fixes: a259ed1618d2 ("bus/fsl-mc: support dma configure for devices on fsl-mc bus")
>
> Is this fixing an actual bug introduced by the blamed commit or are we
> talking only about the warning message?
It is just a warning message.
I did more test today. I reverted it on my LX2160A with the SMMU-less config and rebooted.
Then, I get this notification:
dprc.1: DMA mask not set
Still the DPRC binds, all DPAA2 children (dpni/dpio/dpbp) probe.
In practice, it is more a cleanup warning/notification. I do not remember why I did state
this commit log that is few month old.
I'll rework the v2 per your suggested common block, I'll drop Cc: stable and update
my commit log accordingly.
Best regards,
Vincent
> Commit 4d8bde883bfb ("OF: Don't set default coherent DMA mask") is the
> one that added the dev_warn.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-31 23:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 22:56 [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device Vincent Jardin via B4 Relay
2026-07-30 15:39 ` Ioana Ciornei
2026-07-31 18:47 ` Vincent Jardin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox