Skip to content

Commit 9eec3f9

Browse files
Xiang Chenjoergroedel
authored andcommitted
iommu/arm-smmu-v3: Implement the map_pages() IOMMU driver callback
Implement the map_pages() callback for ARM SMMUV3 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 SMMUV3 driver as it will no longer be used. Signed-off-by: Xiang Chen <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 59103c7 commit 9eec3f9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,15 +2439,16 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
24392439
return ret;
24402440
}
24412441

2442-
static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,
2443-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
2442+
static int arm_smmu_map_pages(struct iommu_domain *domain, unsigned long iova,
2443+
phys_addr_t paddr, size_t pgsize, size_t pgcount,
2444+
int prot, gfp_t gfp, size_t *mapped)
24442445
{
24452446
struct io_pgtable_ops *ops = to_smmu_domain(domain)->pgtbl_ops;
24462447

24472448
if (!ops)
24482449
return -ENODEV;
24492450

2450-
return ops->map(ops, iova, paddr, size, prot, gfp);
2451+
return ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, gfp, mapped);
24512452
}
24522453

24532454
static size_t arm_smmu_unmap_pages(struct iommu_domain *domain, unsigned long iova,
@@ -2823,7 +2824,7 @@ static struct iommu_ops arm_smmu_ops = {
28232824
.domain_alloc = arm_smmu_domain_alloc,
28242825
.domain_free = arm_smmu_domain_free,
28252826
.attach_dev = arm_smmu_attach_dev,
2826-
.map = arm_smmu_map,
2827+
.map_pages = arm_smmu_map_pages,
28272828
.unmap_pages = arm_smmu_unmap_pages,
28282829
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
28292830
.iotlb_sync = arm_smmu_iotlb_sync,

0 commit comments

Comments
 (0)