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

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: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/ccc21bf7d1d0da8989d4d517a13d0846d6b71a38.1694525662.git.robin.murphy@arm.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent dc9ffd8d
...@@ -816,7 +816,8 @@ static int rk_iommu_map_iova(struct rk_iommu_domain *rk_domain, u32 *pte_addr, ...@@ -816,7 +816,8 @@ static int rk_iommu_map_iova(struct rk_iommu_domain *rk_domain, u32 *pte_addr,
} }
static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova, static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova,
phys_addr_t paddr, size_t size, int prot, gfp_t gfp) phys_addr_t paddr, size_t size, size_t count,
int prot, gfp_t gfp, size_t *mapped)
{ {
struct rk_iommu_domain *rk_domain = to_rk_domain(domain); struct rk_iommu_domain *rk_domain = to_rk_domain(domain);
unsigned long flags; unsigned long flags;
...@@ -849,12 +850,14 @@ static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova, ...@@ -849,12 +850,14 @@ static int rk_iommu_map(struct iommu_domain *domain, unsigned long _iova,
paddr, size, prot); paddr, size, prot);
spin_unlock_irqrestore(&rk_domain->dt_lock, flags); spin_unlock_irqrestore(&rk_domain->dt_lock, flags);
if (!ret)
*mapped = size;
return ret; return ret;
} }
static size_t rk_iommu_unmap(struct iommu_domain *domain, unsigned long _iova, static size_t rk_iommu_unmap(struct iommu_domain *domain, unsigned long _iova,
size_t size, struct iommu_iotlb_gather *gather) size_t size, size_t count, struct iommu_iotlb_gather *gather)
{ {
struct rk_iommu_domain *rk_domain = to_rk_domain(domain); struct rk_iommu_domain *rk_domain = to_rk_domain(domain);
unsigned long flags; unsigned long flags;
...@@ -1167,8 +1170,8 @@ static const struct iommu_ops rk_iommu_ops = { ...@@ -1167,8 +1170,8 @@ static const struct iommu_ops rk_iommu_ops = {
.of_xlate = rk_iommu_of_xlate, .of_xlate = rk_iommu_of_xlate,
.default_domain_ops = &(const struct iommu_domain_ops) { .default_domain_ops = &(const struct iommu_domain_ops) {
.attach_dev = rk_iommu_attach_device, .attach_dev = rk_iommu_attach_device,
.map = rk_iommu_map, .map_pages = rk_iommu_map,
.unmap = rk_iommu_unmap, .unmap_pages = rk_iommu_unmap,
.iova_to_phys = rk_iommu_iova_to_phys, .iova_to_phys = rk_iommu_iova_to_phys,
.free = rk_iommu_domain_free, .free = rk_iommu_domain_free,
} }
......
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