aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2014-02-04 23:08:57 +0000
committerAlex Shi <alex.shi@linaro.org>2014-04-21 21:08:32 +0800
commitbccd63d17a9c1814a649d4bbba4bcaeeadf8458f (patch)
tree27da2b331e3244945c12455560f6ef142af9bcc0
parent54a9256c2ecaa741bfe469a89ebfe4399af16be6 (diff)
downloadlinux-linaro-stable-v3.10/topic/old-arm64-cma.tar.gz
arm64: Align CMA sizes to PAGE_SIZEv3.10/topic/old-arm64-cma
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> (cherry picked from commit ccc9e244eb1b9654915634827322932cbafd8244) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--arch/arm64/mm/dma-mapping.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 7821d016bb46..550873ace597 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -40,6 +40,7 @@ static void *__dma_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)