Thread (9 messages) 9 messages, 3 authors, 2025-12-15

Re: [PATCH V6 1/4] iommu/tegra241-cmdqv: Decouple driver from ACPI

From: Nicolin Chen <hidden>
Date: 2025-12-12 19:46:43
Also in: linux-devicetree, linux-iommu, linux-tegra, lkml
Subsystem: arm smmu drivers, iommu subsystem, the rest · Maintainers: Will Deacon, Joerg Roedel, Linus Torvalds

On Fri, Dec 12, 2025 at 12:01:41PM +0000, Robin Murphy wrote:
quoted
@@ -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.
quoted
-		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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help