iommu/sva: Use GFP_KERNEL for pasid allocation
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Wed, 22 Mar 2023 20:08:01 +0000 (13:08 -0700)
committerJoerg Roedel <jroedel@suse.de>
Fri, 31 Mar 2023 08:03:26 +0000 (10:03 +0200)
We’re not using spinlock-protected IOASID allocation anymore, there’s
no need for GFP_ATOMIC.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Link: https://lore.kernel.org/r/20230322200803.869130-6-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu-sva.c

index 48e8a15..c434b95 100644 (file)
@@ -28,8 +28,8 @@ static int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t ma
                goto out;
        }
 
-       ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_ATOMIC);
-       if (ret < 0)
+       ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_KERNEL);
+       if (ret < min)
                goto out;
        mm->pasid = ret;
        ret = 0;