diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2013-02-05 23:21:14 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2013-02-25 09:30:43 -0500 |
commit | 60460abffc71523d65774f43ce1252972eeb0629 (patch) | |
tree | 07c55cb6ad9d203c95a2fae8a2de4e0ea25e9a3e /arch/arm/mm | |
parent | f8669bef11fadfe811a5d7d59cb327499edac088 (diff) |
ARM: dma-mapping: Add maximum alignment order for dma iommu buffers
Alignment order for a dma iommu buffer is set by buffer size. For
large buffer, it is a waste of iommu address space. So configurable
parameter to limit maximum alignment order can reduce the waste.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 2163af4b31b8..6e2511561c3e 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -1029,6 +1029,9 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping, | |||
1029 | unsigned int count, start; | 1029 | unsigned int count, start; |
1030 | unsigned long flags; | 1030 | unsigned long flags; |
1031 | 1031 | ||
1032 | if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT) | ||
1033 | order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT; | ||
1034 | |||
1032 | count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) + | 1035 | count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) + |
1033 | (1 << mapping->order) - 1) >> mapping->order; | 1036 | (1 << mapping->order) - 1) >> mapping->order; |
1034 | 1037 | ||