> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Sent: Wednesday, March 27, 2024 8:55 PM > > @@ -3375,7 +3376,7 @@ int iommu_attach_device_pasid(struct > iommu_domain *domain, > > ret = __iommu_set_group_pasid(domain, group, pasid); > if (ret) { > - __iommu_remove_group_pasid(group, pasid); > + __iommu_remove_group_pasid(group, pasid, domain); > xa_erase(&group->pasid_array, pasid); I didn't get why this patch alone fixes anything. You are passing the new domain which is same as original code which gets it from xarray. so it is at most a non-functional refactoring with the next patch doing real fix?