Commit ccc9e244 authored by Laura Abbott's avatar Laura Abbott Committed by Catalin Marinas
Browse files

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 <>
Signed-off-by: default avatarLaura Abbott <>
Signed-off-by: default avatarCatalin Marinas <>
parent 5044bad4
...@@ -45,6 +45,7 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size, ...@@ -45,6 +45,7 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size,
struct page *page; struct page *page;
size = PAGE_ALIGN(size);
page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT,
get_order(size)); get_order(size));
if (!page) if (!page)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment