Skip to content

Commit 8080353

Browse files
Isaac J. Manjarresjoergroedel
authored andcommitted
iommu/arm-smmu: Implement the map_pages() IOMMU driver callback
Implement the map_pages() callback for the ARM SMMU driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also, remove the map() callback for the ARM SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres <[email protected]> Suggested-by: Will Deacon <[email protected]> Signed-off-by: Georgi Djakov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9ea1a2c commit 8080353

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/iommu/arm/arm-smmu/arm-smmu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,8 +1198,9 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
11981198
return ret;
11991199
}
12001200

1201-
static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,
1202-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
1201+
static int arm_smmu_map_pages(struct iommu_domain *domain, unsigned long iova,
1202+
phys_addr_t paddr, size_t pgsize, size_t pgcount,
1203+
int prot, gfp_t gfp, size_t *mapped)
12031204
{
12041205
struct io_pgtable_ops *ops = to_smmu_domain(domain)->pgtbl_ops;
12051206
struct arm_smmu_device *smmu = to_smmu_domain(domain)->smmu;
@@ -1209,7 +1210,7 @@ static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,
12091210
return -ENODEV;
12101211

12111212
arm_smmu_rpm_get(smmu);
1212-
ret = ops->map(ops, iova, paddr, size, prot, gfp);
1213+
ret = ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, gfp, mapped);
12131214
arm_smmu_rpm_put(smmu);
12141215

12151216
return ret;
@@ -1583,7 +1584,7 @@ static struct iommu_ops arm_smmu_ops = {
15831584
.domain_alloc = arm_smmu_domain_alloc,
15841585
.domain_free = arm_smmu_domain_free,
15851586
.attach_dev = arm_smmu_attach_dev,
1586-
.map = arm_smmu_map,
1587+
.map_pages = arm_smmu_map_pages,
15871588
.unmap_pages = arm_smmu_unmap_pages,
15881589
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
15891590
.iotlb_sync = arm_smmu_iotlb_sync,

0 commit comments

Comments
 (0)