[PATCH v11 7/9] iommu/arm-smmu-v3: Add struct arm_smmu_impl
Nicolin Chen
nicolinc at nvidia.com
Wed Aug 14 22:26:19 PDT 2024
Hi Jason,
I've addressed all the comments here. Two additional replies below.
On Wed, Aug 14, 2024 at 06:52:46PM -0300, Jason Gunthorpe wrote:
> /*
> * Probe all the compiled in implementations. Each one checks to see if it
> * matches this HW and if so returns a devm_krealloc'd arm_smmu_device which
> * replaces the callers. Otherwise the original is returned or ERR_PTR.
> *
> */
> static struct arm_smmu_device *arm_smmu_probe_impl(struct arm_smmu_device *orig_smmu)
> {
> struct arm_smmu_device *new_smmu;
> int ret;
>
> new_smmu = tegra241_cmdqv_acpi_dsdt_probe(orig_smmu);
> if (new_smmu != ERR_PTR(-ENODEV))
> goto out_new_impl;
> return orig_smmu;
>
> out_new_impl:
> if (IS_ERR(new_smmu))
> return new_smmu;
>
> /* FIXME: check is this ordering OK during remove? */
I am not able to test-verify this. At least CMDQV seems to be OK
to remove after SMMU.
> > @@ -4560,6 +4602,7 @@ static void arm_smmu_device_remove(struct platform_device *pdev)
> > {
> > struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
> >
> > + arm_smmu_impl_remove(smmu);
>
> Can't call this if devm has been used to set it up, and this would be
> in the wrong order anyhow. Just remove it.. I guess the devm was put
> for this to avoid adding goto error unwind to probe?
I got that from Will's patch, and I think so, as it does simplify
the unwind routine.
Thanks!
Nicolin
More information about the linux-arm-kernel
mailing list