diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2013-02-06 13:21:14 +0900 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2013-02-25 15:30:43 +0100 |
commit | 60460abffc71523d65774f43ce1252972eeb0629 (patch) | |
tree | 07c55cb6ad9d203c95a2fae8a2de4e0ea25e9a3e /arch/arm/mm/dma-mapping.c | |
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/dma-mapping.c')
-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 2163af4b31b..6e2511561c3 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, unsigned int count, start; unsigned long flags; + if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT) + order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT; + count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) + (1 << mapping->order) - 1) >> mapping->order; |