[PATCH 01/10] iommu: Remove useless group refcounting

Tian, Kevin kevin.tian at intel.com
Sun Jul 23 19:11:44 PDT 2023


> From: Jason Gunthorpe <jgg at nvidia.com>
> Sent: Friday, July 21, 2023 8:02 PM
> 
> On Fri, Jul 21, 2023 at 07:10:57AM +0000, Tian, Kevin wrote:
> > > From: Jason Gunthorpe <jgg at nvidia.com>
> > > Sent: Wednesday, July 19, 2023 3:06 AM
> > >
> > >  int iommu_device_use_default_domain(struct device *dev)
> > >  {
> > > -	struct iommu_group *group = iommu_group_get(dev);
> > > +	/* Caller must be a probed driver on dev */
> > > +	struct iommu_group *group = dev->iommu_group;
> > >  	int ret = 0;
> >
> > this is called in the probing path by .dma_configure().
> >
> > the driver hasn't been probed yet hence the rationale to not
> > refcount is due to device_lock() instead?
> 
> At this point the driver core has partially attached/detached a driver
> so I'm considering it part of the probed driver explanation.
> 
> Really during anything protected by the driver core probe path is
> assured that the group cannot change.
> 

Probably this worths a slightly different comment then?



More information about the linux-arm-kernel mailing list