Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14189
b: refs/heads/master
c: 47492d3
h: refs/heads/master
i:
  14187: ac22150
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Nov 15, 2005
1 parent 0b90340 commit c424d31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07808b74e7dab1aa385e698795875337d72daf7d
refs/heads/master: 47492d3667ec519172ab978bd8231b8c7152fa9d
8 changes: 7 additions & 1 deletion trunk/arch/x86_64/kernel/pci-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
uses the normal dma_mask for alloc_coherent. */
dma_mask &= *dev->dma_mask;

/* Why <=? Even when the mask is smaller than 4GB it is often larger
than 16MB and in this case we have a chance of finding fitting memory
in the next higher zone first. If not retry with true GFP_DMA. -AK */
if (dma_mask <= 0xffffffff)
gfp |= GFP_DMA32;

again:
memory = dma_alloc_pages(dev, gfp, get_order(size));
if (memory == NULL)
Expand All @@ -245,7 +251,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
}

if (!(gfp & GFP_DMA)) {
gfp |= GFP_DMA;
gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
goto again;
}
return NULL;
Expand Down

0 comments on commit c424d31

Please sign in to comment.