Lines Matching refs:domain
61 struct iommu_domain *domain; in iommu_sva_bind_device() local
76 domain = iommu_get_domain_for_dev_pasid(dev, mm->pasid, in iommu_sva_bind_device()
78 if (IS_ERR(domain)) { in iommu_sva_bind_device()
79 ret = PTR_ERR(domain); in iommu_sva_bind_device()
83 if (domain) { in iommu_sva_bind_device()
84 domain->users++; in iommu_sva_bind_device()
89 domain = iommu_sva_domain_alloc(dev, mm); in iommu_sva_bind_device()
90 if (!domain) { in iommu_sva_bind_device()
95 ret = iommu_attach_device_pasid(domain, dev, mm->pasid); in iommu_sva_bind_device()
98 domain->users = 1; in iommu_sva_bind_device()
102 handle->domain = domain; in iommu_sva_bind_device()
107 iommu_domain_free(domain); in iommu_sva_bind_device()
126 struct iommu_domain *domain = handle->domain; in iommu_sva_unbind_device() local
127 ioasid_t pasid = domain->mm->pasid; in iommu_sva_unbind_device()
131 if (--domain->users == 0) { in iommu_sva_unbind_device()
132 iommu_detach_device_pasid(domain, dev, pasid); in iommu_sva_unbind_device()
133 iommu_domain_free(domain); in iommu_sva_unbind_device()
142 struct iommu_domain *domain = handle->domain; in iommu_sva_get_pasid() local
144 return domain->mm->pasid; in iommu_sva_get_pasid()