> From: Jason Gunthorpe <jgg@xxxxxxxxxx> > Sent: Tuesday, November 8, 2022 8:49 AM > +static int __iommu_take_dma_ownership(struct iommu_group *group, void > *owner) > +{ > + int ret; > + > + if (WARN_ON(!owner)) > + return -EINVAL; move to iommu_device_claim_dma_owner(). just like how it's checked in the group version. > + > + if ((group->domain && group->domain != group->default_domain) || > + !xa_empty(&group->pasid_array)) > + return -EBUSY; the check of pasid_array is a new addition in this version. it's probably worthy a comment here. otherwise, Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>