diff options
author | Seung-Woo Kim | 2013-02-06 05:21:14 +0100 |
---|---|---|
committer | Marek Szyprowski | 2013-02-25 15:30:43 +0100 |
commit | 60460abffc71523d65774f43ce1252972eeb0629 (patch) | |
tree | 07c55cb6ad9d203c95a2fae8a2de4e0ea25e9a3e /arch/arm/mm/dma-mapping.c | |
parent | ARM: dma-mapping: use himem for DMA buffers for IOMMU-mapped devices (diff) | |
download | kernel-qcow2-linux-60460abffc71523d65774f43ce1252972eeb0629.tar.gz kernel-qcow2-linux-60460abffc71523d65774f43ce1252972eeb0629.tar.xz kernel-qcow2-linux-60460abffc71523d65774f43ce1252972eeb0629.zip |
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 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, 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; |