]> Git Repo - J-linux.git/commitdiff
iommufd: Use iommu_paging_domain_alloc()
authorLu Baolu <[email protected]>
Mon, 10 Jun 2024 08:55:36 +0000 (16:55 +0800)
committerWill Deacon <[email protected]>
Thu, 4 Jul 2024 13:09:33 +0000 (14:09 +0100)
If the iommu driver doesn't implement its domain_alloc_user callback,
iommufd_hwpt_paging_alloc() rolls back to allocate an iommu paging domain.
Replace iommu_domain_alloc() with iommu_user_domain_alloc() to pass the
device pointer along the path.

Signed-off-by: Lu Baolu <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
drivers/iommu/iommufd/hw_pagetable.c

index 33d142f8057d70a77f44e842afdd84b1bee0a970..cbddfa3ca95aa8ad5f40d8ea63dd40c9d5d4a292 100644 (file)
@@ -137,9 +137,10 @@ iommufd_hwpt_paging_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas,
                }
                hwpt->domain->owner = ops;
        } else {
-               hwpt->domain = iommu_domain_alloc(idev->dev->bus);
-               if (!hwpt->domain) {
-                       rc = -ENOMEM;
+               hwpt->domain = iommu_paging_domain_alloc(idev->dev);
+               if (IS_ERR(hwpt->domain)) {
+                       rc = PTR_ERR(hwpt->domain);
+                       hwpt->domain = NULL;
                        goto out_abort;
                }
        }
This page took 0.062271 seconds and 4 git commands to generate.