[PATCH V6 1/4] iommu/tegra241-cmdqv: Decouple driver from ACPI
Nicolin Chen
nicolinc at nvidia.com
Fri Dec 12 11:46:13 PST 2025
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
More information about the linux-arm-kernel
mailing list