Re: [PATCH] bus: fsl-mc: set dma_mask for the root DPRC device
From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: 2026-07-30 15:40:21
Also in:
lkml, stable
On Fri, Jul 24, 2026 at 12:56:33AM +0200, Vincent Jardin via B4 Relay wrote:
From: Vincent Jardin <redacted>
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.
quoted hunk ↗ jump to hunk
Cc: stable@vger.kernel.org Signed-off-by: Vincent Jardin <redacted> --- 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