Commit b9bf41e2 authored by Robin Murphy's avatar Robin Murphy Committed by Joerg Roedel

iommu/io-pgtable-arm-v7s: Remove map/unmap

With all users now calling {map,unmap}_pages, remove the wrappers.
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/98481dd7e3576b74149ce2de8f217338ee1dd490.1668100209.git.robin.murphy@arm.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 99cbb8e4
...@@ -564,8 +564,7 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova, ...@@ -564,8 +564,7 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
iova += pgsize; iova += pgsize;
paddr += pgsize; paddr += pgsize;
if (mapped) *mapped += pgsize;
*mapped += pgsize;
} }
/* /*
* Synchronise all PTE updates for the new mapping before there's * Synchronise all PTE updates for the new mapping before there's
...@@ -576,12 +575,6 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova, ...@@ -576,12 +575,6 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
return ret; return ret;
} }
static int arm_v7s_map(struct io_pgtable_ops *ops, unsigned long iova,
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
{
return arm_v7s_map_pages(ops, iova, paddr, size, 1, prot, gfp, NULL);
}
static void arm_v7s_free_pgtable(struct io_pgtable *iop) static void arm_v7s_free_pgtable(struct io_pgtable *iop)
{ {
struct arm_v7s_io_pgtable *data = io_pgtable_to_data(iop); struct arm_v7s_io_pgtable *data = io_pgtable_to_data(iop);
...@@ -764,12 +757,6 @@ static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova ...@@ -764,12 +757,6 @@ static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova
return unmapped; return unmapped;
} }
static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova,
size_t size, struct iommu_iotlb_gather *gather)
{
return arm_v7s_unmap_pages(ops, iova, size, 1, gather);
}
static phys_addr_t arm_v7s_iova_to_phys(struct io_pgtable_ops *ops, static phys_addr_t arm_v7s_iova_to_phys(struct io_pgtable_ops *ops,
unsigned long iova) unsigned long iova)
{ {
...@@ -842,9 +829,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, ...@@ -842,9 +829,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg,
goto out_free_data; goto out_free_data;
data->iop.ops = (struct io_pgtable_ops) { data->iop.ops = (struct io_pgtable_ops) {
.map = arm_v7s_map,
.map_pages = arm_v7s_map_pages, .map_pages = arm_v7s_map_pages,
.unmap = arm_v7s_unmap,
.unmap_pages = arm_v7s_unmap_pages, .unmap_pages = arm_v7s_unmap_pages,
.iova_to_phys = arm_v7s_iova_to_phys, .iova_to_phys = arm_v7s_iova_to_phys,
}; };
...@@ -954,6 +939,7 @@ static int __init arm_v7s_do_selftests(void) ...@@ -954,6 +939,7 @@ static int __init arm_v7s_do_selftests(void)
}; };
unsigned int iova, size, iova_start; unsigned int iova, size, iova_start;
unsigned int i, loopnr = 0; unsigned int i, loopnr = 0;
size_t mapped;
selftest_running = true; selftest_running = true;
...@@ -984,15 +970,16 @@ static int __init arm_v7s_do_selftests(void) ...@@ -984,15 +970,16 @@ static int __init arm_v7s_do_selftests(void)
iova = 0; iova = 0;
for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) { for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
size = 1UL << i; size = 1UL << i;
if (ops->map(ops, iova, iova, size, IOMMU_READ | if (ops->map_pages(ops, iova, iova, size, 1,
IOMMU_WRITE | IOMMU_READ | IOMMU_WRITE |
IOMMU_NOEXEC | IOMMU_NOEXEC | IOMMU_CACHE,
IOMMU_CACHE, GFP_KERNEL)) GFP_KERNEL, &mapped))
return __FAIL(ops); return __FAIL(ops);
/* Overlapping mappings */ /* Overlapping mappings */
if (!ops->map(ops, iova, iova + size, size, if (!ops->map_pages(ops, iova, iova + size, size, 1,
IOMMU_READ | IOMMU_NOEXEC, GFP_KERNEL)) IOMMU_READ | IOMMU_NOEXEC, GFP_KERNEL,
&mapped))
return __FAIL(ops); return __FAIL(ops);
if (ops->iova_to_phys(ops, iova + 42) != (iova + 42)) if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
...@@ -1007,11 +994,12 @@ static int __init arm_v7s_do_selftests(void) ...@@ -1007,11 +994,12 @@ static int __init arm_v7s_do_selftests(void)
size = 1UL << __ffs(cfg.pgsize_bitmap); size = 1UL << __ffs(cfg.pgsize_bitmap);
while (i < loopnr) { while (i < loopnr) {
iova_start = i * SZ_16M; iova_start = i * SZ_16M;
if (ops->unmap(ops, iova_start + size, size, NULL) != size) if (ops->unmap_pages(ops, iova_start + size, size, 1, NULL) != size)
return __FAIL(ops); return __FAIL(ops);
/* Remap of partial unmap */ /* Remap of partial unmap */
if (ops->map(ops, iova_start + size, size, size, IOMMU_READ, GFP_KERNEL)) if (ops->map_pages(ops, iova_start + size, size, size, 1,
IOMMU_READ, GFP_KERNEL, &mapped))
return __FAIL(ops); return __FAIL(ops);
if (ops->iova_to_phys(ops, iova_start + size + 42) if (ops->iova_to_phys(ops, iova_start + size + 42)
...@@ -1025,14 +1013,15 @@ static int __init arm_v7s_do_selftests(void) ...@@ -1025,14 +1013,15 @@ static int __init arm_v7s_do_selftests(void)
for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) { for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
size = 1UL << i; size = 1UL << i;
if (ops->unmap(ops, iova, size, NULL) != size) if (ops->unmap_pages(ops, iova, size, 1, NULL) != size)
return __FAIL(ops); return __FAIL(ops);
if (ops->iova_to_phys(ops, iova + 42)) if (ops->iova_to_phys(ops, iova + 42))
return __FAIL(ops); return __FAIL(ops);
/* Remap full block */ /* Remap full block */
if (ops->map(ops, iova, iova, size, IOMMU_WRITE, GFP_KERNEL)) if (ops->map_pages(ops, iova, iova, size, 1, IOMMU_WRITE,
GFP_KERNEL, &mapped))
return __FAIL(ops); return __FAIL(ops);
if (ops->iova_to_phys(ops, iova + 42) != (iova + 42)) if (ops->iova_to_phys(ops, iova + 42) != (iova + 42))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment