Skip to content

Commit

Permalink
ARM: Use GFP_DMA only for masks _less_ than 32-bit
Browse files Browse the repository at this point in the history
We were using GFP_DMA for masks other than 0xffffffff, which is
wrong when some masks are initialized to 0xffffffffffffffff.
This caused such masks to obtain memory from the precious DMA
pool.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Oct 25, 2009
1 parent ce63e6b commit c06e004
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,

order = get_order(size);

if (mask != 0xffffffff)
if (mask < 0xffffffffULL)
gfp |= GFP_DMA;

page = alloc_pages(gfp, order);
Expand Down Expand Up @@ -289,7 +289,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
if (!mask)
goto error;

if (mask != 0xffffffff)
if (mask < 0xffffffffULL)
gfp |= GFP_DMA;
virt = kmalloc(size, gfp);
if (!virt)
Expand Down

0 comments on commit c06e004

Please sign in to comment.