linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Ashish Mhetre <amhetre@nvidia.com>, <will@kernel.org>,
	<joro@8bytes.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
	<conor+dt@kernel.org>, <thierry.reding@gmail.com>,
	<jonathanh@nvidia.com>, <vdumpa@nvidia.com>, <jgg@ziepe.ca>,
	<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-tegra@vger.kernel.org>
Subject: Re: [PATCH V6 1/4] iommu/tegra241-cmdqv: Decouple driver from ACPI
Date: Fri, 12 Dec 2025 11:46:13 -0800	[thread overview]
Message-ID: <aTxxBdcY4hODXcdu@nvidia.com> (raw)
In-Reply-To: <54fce1f8-7675-4351-b292-0009b2e8c599@arm.com>

On Fri, Dec 12, 2025 at 12:01:41PM +0000, Robin Murphy wrote:
> > @@ -4542,7 +4542,7 @@ static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node,
> >   	adev = acpi_dev_get_first_match_dev("NVDA200C", uid, -1);
> >   	if (adev) {
> >   		/* Tegra241 CMDQV driver is responsible for put_device() */
> 
> Don't we need to bring the put_device(adev) out to this level, since
> impl_dev is now something else that AFAICS we are *not* taking a new
> reference on (and thus should not be putting either)?

Ah, right! We are using the platform device now.

> > -		smmu->impl_dev = &adev->dev;
> > +		smmu->impl_dev = acpi_get_first_physical_node(adev);
> >   		smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
> >   		dev_info(smmu->dev, "found companion CMDQV device: %s\n",
> >   			 dev_name(smmu->impl_dev));

I think we should squash this:

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 0c98be3135c63..88625e3c27a65 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -5280,10 +5280,11 @@ static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node,
 	adev = acpi_dev_get_first_match_dev("NVDA200C", uid, -1);
 	if (adev) {
 		/* Tegra241 CMDQV driver is responsible for put_device() */
-		smmu->impl_dev = acpi_get_first_physical_node(adev);
+		smmu->impl_dev = get_device(acpi_get_first_physical_node(adev));
 		smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
 		dev_info(smmu->dev, "found companion CMDQV device: %s\n",
 			 dev_name(smmu->impl_dev));
+		acpi_dev_put(adev);
 	}
 	kfree(uid);
 }

Thanks
Nicolin


  reply	other threads:[~2025-12-12 19:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12  6:07 [PATCH V6 0/4] Add device tree support for NVIDIA Tegra CMDQV Ashish Mhetre
2025-12-12  6:08 ` [PATCH V6 1/4] iommu/tegra241-cmdqv: Decouple driver from ACPI Ashish Mhetre
2025-12-12 12:01   ` Robin Murphy
2025-12-12 19:46     ` Nicolin Chen [this message]
2025-12-12 20:36       ` Robin Murphy
2025-12-15  6:09         ` Ashish Mhetre
2025-12-12  6:08 ` [PATCH V6 2/4] iommu/arm-smmu-v3: Add device-tree support for CMDQV driver Ashish Mhetre
2025-12-12  6:08 ` [PATCH V6 3/4] dt-bindings: iommu: Add NVIDIA Tegra CMDQV support Ashish Mhetre
2025-12-12  6:08 ` [PATCH V6 4/4] arm64: dts: nvidia: Add nodes for CMDQV Ashish Mhetre

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=aTxxBdcY4hODXcdu@nvidia.com \
    --to=nicolinc@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).