Re: [PATCH 2/3] iommu/arm-smmu-v3: Populate PMU child devices from Devicetree

sashiko-bot
2026-04-08T08:39:05Z

Sashiko AI review found 1 potential issue(s):
- [High] Premature population of child devices before the parent SMMU is initialized.
--

commit b6188437ce3fc797b1e6f4d35f8ab59a8362fd98
Author: Peng Fan <peng.fan@nxp.com>

iommu/arm-smmu-v3: Populate PMU child devices from Devicetree

This commit populates optional child devices of the Arm SMMU v3,
such as the PMCG-based PMU, by instantiating them during the device
tree probe phase.

> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -5363,6 +5363,9 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev,
> if (of_device_is_compatible(dev->of_node, "nvidia,tegra264-smmu"))
> tegra_cmdqv_dt_probe(dev->of_node, smmu);
>
> + if (!ret)
> + return devm_of_platform_populate(dev);

Will calling devm_of_platform_populate() this early cause the child
platform devices to be probed before the parent SMMU is fully
initialized?

If a child device depends on the parent being fully set up, might it
fail since arm_smmu_device_dt_probe() is called early in the parent's
probe sequence, before IO memory is mapped, hardware is initialized, or
platform_set_drvdata() is called?

Additionally, if a subsequent step in the parent's probe returns
-EPROBE_DEFER, will this result in unnecessary probing and immediate
devres teardown of the child devices?

Would it be safer to defer populating the child devices until the end
of arm_smmu_device_probe() after the parent SMMU has successfully
initialized?

> +
> return ret;
> }

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260408-smmu-perf-v1-0-d75dac96e828@nxp.com?part=2