diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2011-11-10 04:32:25 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-11-10 05:40:37 -0500 |
commit | 5009065d38c95455bd2d27c2838313e3dd0c5bc7 (patch) | |
tree | a957af07e95166bcc014b3f333234fe74cef790e /drivers/iommu/iommu.c | |
parent | 1ea6b8f48918282bdca0b32a34095504ee65bab5 (diff) |
iommu/core: stop converting bytes to page order back and forth
Express sizes in bytes rather than in page order, to eliminate the
size->order->size conversions we have whenever the IOMMU API is calling
the low level drivers' map/unmap methods.
Adopt all existing drivers.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <Joerg.Roedel@amd.com>
Cc: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: KyongHo Cho <pullip.cho@samsung.com>
Cc: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r-- | drivers/iommu/iommu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 2fb2963df553..7a2953d8f12e 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c | |||
@@ -168,13 +168,13 @@ int iommu_map(struct iommu_domain *domain, unsigned long iova, | |||
168 | 168 | ||
169 | BUG_ON(!IS_ALIGNED(iova | paddr, size)); | 169 | BUG_ON(!IS_ALIGNED(iova | paddr, size)); |
170 | 170 | ||
171 | return domain->ops->map(domain, iova, paddr, gfp_order, prot); | 171 | return domain->ops->map(domain, iova, paddr, size, prot); |
172 | } | 172 | } |
173 | EXPORT_SYMBOL_GPL(iommu_map); | 173 | EXPORT_SYMBOL_GPL(iommu_map); |
174 | 174 | ||
175 | int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) | 175 | int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) |
176 | { | 176 | { |
177 | size_t size; | 177 | size_t size, unmapped; |
178 | 178 | ||
179 | if (unlikely(domain->ops->unmap == NULL)) | 179 | if (unlikely(domain->ops->unmap == NULL)) |
180 | return -ENODEV; | 180 | return -ENODEV; |
@@ -183,6 +183,8 @@ int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) | |||
183 | 183 | ||
184 | BUG_ON(!IS_ALIGNED(iova, size)); | 184 | BUG_ON(!IS_ALIGNED(iova, size)); |
185 | 185 | ||
186 | return domain->ops->unmap(domain, iova, gfp_order); | 186 | unmapped = domain->ops->unmap(domain, iova, size); |
187 | |||
188 | return get_order(unmapped); | ||
187 | } | 189 | } |
188 | EXPORT_SYMBOL_GPL(iommu_unmap); | 190 | EXPORT_SYMBOL_GPL(iommu_unmap); |