summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Doyu <hdoyu@nvidia.com>2013-05-15 10:38:18 +0300
committerHarshada Kale <hkale@nvidia.com>2013-06-10 03:52:25 -0700
commit93e0205afe3e9a9b4e28c955d446d011a036a272 (patch)
treec3cefca3fc63cb264e9070e9d9dcba4685ee55a2
parent0c491266b1583f76e83311187d6a930187a9152e (diff)
ARM: dma-mapping: Round-up IOVA map base
This is necessary for iova_alloc_at(). On high order allocation, the lower bit of base was ignored, and it returns incorrect IOVA address. bug 1286500 Change-Id: I0be96b97c8036f8a5bc1c35a1c85e04593021a2b (cherry picked from commit from 578a5333d43b2c9a78f0a234d391c2f8f5382b5d) Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/234136 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
-rw-r--r--arch/arm/mm/dma-mapping.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 9dfe4798a330..2f3cbcdeabcd 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1898,6 +1898,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size,
if (!mapping->bitmap)
goto err2;
+ base = round_up(base, 1 << (order + PAGE_SHIFT));
mapping->base = base;
mapping->bits = BITS_PER_BYTE * bitmap_size;
mapping->order = order;