Skip to content

Commit dc9ffd8

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

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,8 @@ static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, int pgsz)
13101310
}
13111311

13121312
static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
1313-
phys_addr_t pa, size_t bytes, int prot, gfp_t gfp)
1313+
phys_addr_t pa, size_t bytes, size_t count,
1314+
int prot, gfp_t gfp, size_t *mapped)
13141315
{
13151316
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
13161317
struct device *dev = omap_domain->dev;
@@ -1348,13 +1349,15 @@ static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
13481349
oiommu = iommu->iommu_dev;
13491350
iopgtable_clear_entry(oiommu, da);
13501351
}
1352+
} else {
1353+
*mapped = bytes;
13511354
}
13521355

13531356
return ret;
13541357
}
13551358

13561359
static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
1357-
size_t size, struct iommu_iotlb_gather *gather)
1360+
size_t size, size_t count, struct iommu_iotlb_gather *gather)
13581361
{
13591362
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
13601363
struct device *dev = omap_domain->dev;
@@ -1730,8 +1733,8 @@ static const struct iommu_ops omap_iommu_ops = {
17301733
.pgsize_bitmap = OMAP_IOMMU_PGSIZES,
17311734
.default_domain_ops = &(const struct iommu_domain_ops) {
17321735
.attach_dev = omap_iommu_attach_dev,
1733-
.map = omap_iommu_map,
1734-
.unmap = omap_iommu_unmap,
1736+
.map_pages = omap_iommu_map,
1737+
.unmap_pages = omap_iommu_unmap,
17351738
.iova_to_phys = omap_iommu_iova_to_phys,
17361739
.free = omap_iommu_domain_free,
17371740
}

0 commit comments

Comments
 (0)