Skip to content

Commit 3611553

Browse files
author
Haavard Skinnemoen
committed
[AVR32] 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 was forward-ported from BSP 2.0 Signed-off-by: Haavard Skinnemoen <[email protected]>
1 parent 4991408 commit 3611553

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/avr32/mm/dma-coherent.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ static struct page *__dma_alloc(struct device *dev, size_t size,
4141
struct page *page, *free, *end;
4242
int order;
4343

44+
/* Following is a work-around (a.k.a. hack) to prevent pages
45+
* with __GFP_COMP being passed to split_page() which cannot
46+
* handle them. The real problem is that this flag probably
47+
* should be 0 on AVR32 as it is not supported on this
48+
* platform--see CONFIG_HUGETLB_PAGE. */
49+
gfp &= ~(__GFP_COMP);
50+
4451
size = PAGE_ALIGN(size);
4552
order = get_order(size);
4653

0 commit comments

Comments
 (0)