Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <chenxiang66@hisilicon.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/1627697831-158822-3-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Xiang Chen and committed by
Joerg Roedel
9eec3f9b 59103c79

+5 -4
+5 -4
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
··· 2439 2439 return ret; 2440 2440 } 2441 2441 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) 2444 2445 { 2445 2446 struct io_pgtable_ops *ops = to_smmu_domain(domain)->pgtbl_ops; 2446 2447 2447 2448 if (!ops) 2448 2449 return -ENODEV; 2449 2450 2450 - return ops->map(ops, iova, paddr, size, prot, gfp); 2451 + return ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, gfp, mapped); 2451 2452 } 2452 2453 2453 2454 static size_t arm_smmu_unmap_pages(struct iommu_domain *domain, unsigned long iova, ··· 2824 2823 .domain_alloc = arm_smmu_domain_alloc, 2825 2824 .domain_free = arm_smmu_domain_free, 2826 2825 .attach_dev = arm_smmu_attach_dev, 2827 - .map = arm_smmu_map, 2826 + .map_pages = arm_smmu_map_pages, 2828 2827 .unmap_pages = arm_smmu_unmap_pages, 2829 2828 .flush_iotlb_all = arm_smmu_flush_iotlb_all, 2830 2829 .iotlb_sync = arm_smmu_iotlb_sync,