Skip to content

Commit ea2e705

Browse files
sumitkbhRussell King
authored andcommitted
ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations
dma_alloc_coherent wants to split pages after allocation in order to reduce the memory footprint. This does not work well with GFP_COMP pages, so drop this flag before allocation. This patch is ported from arch/avr32 (commit 3611553). [swarren: s/HUGETLB_PAGE/HUGETLBFS/ in comment, minor comment cleanup] Signed-off-by: Sumit Bhattacharya <[email protected]> Tested-by: Varun Colbert <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent c36ef4b commit ea2e705

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
332332
struct page *page;
333333
void *addr;
334334

335+
/*
336+
* Following is a work-around (a.k.a. hack) to prevent pages
337+
* with __GFP_COMP being passed to split_page() which cannot
338+
* handle them. The real problem is that this flag probably
339+
* should be 0 on ARM as it is not supported on this
340+
* platform; see CONFIG_HUGETLBFS.
341+
*/
342+
gfp &= ~(__GFP_COMP);
343+
335344
*handle = ~0;
336345
size = PAGE_ALIGN(size);
337346

0 commit comments

Comments
 (0)