Skip to content

Commit d47b977

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/rockchip: 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/ccc21bf7d1d0da8989d4d517a13d0846d6b71a38.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent dc9ffd8 commit d47b977

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/iommu/rockchip-iommu.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,8 @@ static int rk_iommu_map_iova(struct rk_iommu_domain *rk_domain, u32 *pte_addr,
816816
}
817817

818818
static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova,
819-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
819+
phys_addr_t paddr, size_t size, size_t count,
820+
int prot, gfp_t gfp, size_t *mapped)
820821
{
821822
struct rk_iommu_domain *rk_domain = to_rk_domain(domain);
822823
unsigned long flags;
@@ -849,12 +850,14 @@ static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova,
849850
paddr, size, prot);
850851

851852
spin_unlock_irqrestore(&rk_domain->dt_lock, flags);
853+
if (!ret)
854+
*mapped = size;
852855

853856
return ret;
854857
}
855858

856859
static size_t rk_iommu_unmap(struct iommu_domain *domain, unsigned long _iova,
857-
size_t size, struct iommu_iotlb_gather *gather)
860+
size_t size, size_t count, struct iommu_iotlb_gather *gather)
858861
{
859862
struct rk_iommu_domain *rk_domain = to_rk_domain(domain);
860863
unsigned long flags;
@@ -1167,8 +1170,8 @@ static const struct iommu_ops rk_iommu_ops = {
11671170
.of_xlate = rk_iommu_of_xlate,
11681171
.default_domain_ops = &(const struct iommu_domain_ops) {
11691172
.attach_dev = rk_iommu_attach_device,
1170-
.map = rk_iommu_map,
1171-
.unmap = rk_iommu_unmap,
1173+
.map_pages = rk_iommu_map,
1174+
.unmap_pages = rk_iommu_unmap,
11721175
.iova_to_phys = rk_iommu_iova_to_phys,
11731176
.free = rk_iommu_domain_free,
11741177
}

0 commit comments

Comments
 (0)