Skip to content

Commit 8c63d1e

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/sun50i: Update to {map,unmap}_pages
Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/395995e5097803f9a65f2fb79e0732d41c2b8a84.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent d47b977 commit 8c63d1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ static u32 *sun50i_dte_get_page_table(struct sun50i_iommu_domain *sun50i_domain,
588588
}
589589

590590
static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
591-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
591+
phys_addr_t paddr, size_t size, size_t count,
592+
int prot, gfp_t gfp, size_t *mapped)
592593
{
593594
struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
594595
struct sun50i_iommu *iommu = sun50i_domain->iommu;
@@ -615,13 +616,14 @@ static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
615616

616617
*pte_addr = sun50i_mk_pte(paddr, prot);
617618
sun50i_table_flush(sun50i_domain, pte_addr, 1);
619+
*mapped = size;
618620

619621
out:
620622
return ret;
621623
}
622624

623625
static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova,
624-
size_t size, struct iommu_iotlb_gather *gather)
626+
size_t size, size_t count, struct iommu_iotlb_gather *gather)
625627
{
626628
struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
627629
phys_addr_t pt_phys;
@@ -838,8 +840,8 @@ static const struct iommu_ops sun50i_iommu_ops = {
838840
.iotlb_sync_map = sun50i_iommu_iotlb_sync_map,
839841
.iotlb_sync = sun50i_iommu_iotlb_sync,
840842
.iova_to_phys = sun50i_iommu_iova_to_phys,
841-
.map = sun50i_iommu_map,
842-
.unmap = sun50i_iommu_unmap,
843+
.map_pages = sun50i_iommu_map,
844+
.unmap_pages = sun50i_iommu_unmap,
843845
.free = sun50i_iommu_domain_free,
844846
}
845847
};

0 commit comments

Comments
 (0)