diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2014-02-04 23:08:57 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-02-05 10:28:27 +0000 |
commit | ccc9e244eb1b9654915634827322932cbafd8244 (patch) | |
tree | ccd48e88d9ecc6d28266669e9fa8ad9a083ff741 | |
parent | 5044bad43ee573d0b6d90e3ccb7a40c2c7d25eb4 (diff) | |
download | blackbird-op-linux-ccc9e244eb1b9654915634827322932cbafd8244.tar.gz blackbird-op-linux-ccc9e244eb1b9654915634827322932cbafd8244.zip |
arm64: Align CMA sizes to PAGE_SIZE
dma_alloc_from_contiguous takes number of pages for a size.
Align up the dma size passed in to page size to avoid truncation
and allocation failures on sizes less than PAGE_SIZE.
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 45b5ab54c9ee..fbd76785c5db 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -45,6 +45,7 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size, if (IS_ENABLED(CONFIG_DMA_CMA)) { struct page *page; + size = PAGE_ALIGN(size); page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, get_order(size)); if (!page) |