Skip to content

Commit 8563738

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/mediatek: Update to {map,unmap}_pages
Update map/unmap to the new multi-page interfaces, which is dead easy since we just pass them through to io-pgtable anyway. Signed-off-by: Robin Murphy <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/25b65b71e7e5d1006469aee48bab07ca87227bfa.1668100209.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent a05d585 commit 8563738

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ static void mtk_iommu_detach_device(struct iommu_domain *domain,
711711
}
712712

713713
static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova,
714-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
714+
phys_addr_t paddr, size_t pgsize, size_t pgcount,
715+
int prot, gfp_t gfp, size_t *mapped)
715716
{
716717
struct mtk_iommu_domain *dom = to_mtk_domain(domain);
717718

@@ -720,17 +721,17 @@ static int mtk_iommu_map(struct iommu_domain *domain, unsigned long iova,
720721
paddr |= BIT_ULL(32);
721722

722723
/* Synchronize with the tlb_lock */
723-
return dom->iop->map(dom->iop, iova, paddr, size, prot, gfp);
724+
return dom->iop->map_pages(dom->iop, iova, paddr, pgsize, pgcount, prot, gfp, mapped);
724725
}
725726

726727
static size_t mtk_iommu_unmap(struct iommu_domain *domain,
727-
unsigned long iova, size_t size,
728+
unsigned long iova, size_t pgsize, size_t pgcount,
728729
struct iommu_iotlb_gather *gather)
729730
{
730731
struct mtk_iommu_domain *dom = to_mtk_domain(domain);
731732

732-
iommu_iotlb_gather_add_range(gather, iova, size);
733-
return dom->iop->unmap(dom->iop, iova, size, gather);
733+
iommu_iotlb_gather_add_range(gather, iova, pgsize * pgcount);
734+
return dom->iop->unmap_pages(dom->iop, iova, pgsize, pgcount, gather);
734735
}
735736

736737
static void mtk_iommu_flush_iotlb_all(struct iommu_domain *domain)
@@ -938,8 +939,8 @@ static const struct iommu_ops mtk_iommu_ops = {
938939
.default_domain_ops = &(const struct iommu_domain_ops) {
939940
.attach_dev = mtk_iommu_attach_device,
940941
.detach_dev = mtk_iommu_detach_device,
941-
.map = mtk_iommu_map,
942-
.unmap = mtk_iommu_unmap,
942+
.map_pages = mtk_iommu_map,
943+
.unmap_pages = mtk_iommu_unmap,
943944
.flush_iotlb_all = mtk_iommu_flush_iotlb_all,
944945
.iotlb_sync = mtk_iommu_iotlb_sync,
945946
.iotlb_sync_map = mtk_iommu_sync_map,

0 commit comments

Comments
 (0)