All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/3] iommu/arm-smmu-v3: Populate PMU child devices from Devicetree
Date: Wed, 08 Apr 2026 08:39:04 +0000	[thread overview]
Message-ID: <20260408083905.147DFC19424@smtp.kernel.org> (raw)
In-Reply-To: <20260408-smmu-perf-v1-2-d75dac96e828@nxp.com>

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

  reply	other threads:[~2026-04-08  8:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  7:51 [PATCH 0/3] arm-smmu-v3: Add PMCG child support and update PMU MMIO mapping Peng Fan (OSS)
2026-04-08  7:51 ` [PATCH 1/3] dt-bindings: iommu: arm-smmu-v3: Allow PMU child nodes Peng Fan (OSS)
2026-04-09  8:10   ` Krzysztof Kozlowski
2026-04-09 12:45     ` Peng Fan
2026-04-08  7:51 ` [PATCH 2/3] iommu/arm-smmu-v3: Populate PMU child devices from Devicetree Peng Fan (OSS)
2026-04-08  8:39   ` sashiko-bot [this message]
2026-04-08  7:51 ` [PATCH 3/3] perf/arm-smmuv3: Avoid double-requesting shared SMMU MMIO for PMCG Peng Fan (OSS)
2026-04-08  8:46   ` sashiko-bot
2026-04-08 11:15 ` [PATCH 0/3] arm-smmu-v3: Add PMCG child support and update PMU MMIO mapping Robin Murphy
2026-04-08 13:47   ` Peng Fan
2026-04-10 12:07     ` Robin Murphy
2026-04-14  7:47       ` Peng Fan
2026-04-14  9:32         ` Robin Murphy

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=20260408083905.147DFC19424@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=peng.fan@oss.nxp.com \
    --cc=sashiko@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.