Re: [PATCH 00/14] iommu: fix device leaks

From: Johan Hovold

Date: Tue Oct 07 2025 - 05:41:34 EST


On Wed, Oct 01, 2025 at 01:01:32PM -0300, Jason Gunthorpe wrote:
> On Wed, Oct 01, 2025 at 11:16:09AM +0200, Johan Hovold wrote:
>
> > This seems to be more a case of developers not reading documentation and
> > copying implementations from existing drivers.
>
> IMHO the drivers are mis-using of_xlate, it shouldn't be looking up
> drvdata at all.

Ok, but that would in any case be a separate issue.

> > > IDK if it is worth fixing like this, or if more effort should be put
> > > to make the drivers use of_xlate properly - the arm smmu drivers show
> > > the only way to use it..
> >
> > As Robin pointed out, those drivers just drop the reference as they
> > should (even if I'd drop the reference after looking up the driver
> > data).
>
> So I wrote the series to clean this up and drop the calls to
> of_find_device_by_node() and so on.
>
> I left dart, exynos, msm and omap as-is, so I suggest you trim this
> series to only those drivers and rely on my version to fix the rest.

Looks like there's some room for unification and code reuse, but that
can be done on top of these fixes.

Johan