aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/kernel/pci-gart.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-15 16:49:04 -0800
committerSteve French <sfrench@us.ibm.com>2005-11-15 16:49:04 -0800
commitc12489ad40a9db6b17225e0f38151d41c6175fe8 (patch)
treecf7ea08c0b3bf106975047c66b8bb0b560cc4e3e /arch/x86_64/kernel/pci-gart.c
parentff7feac9638e162263463edaeb342b4f3b1ce90e (diff)
parent1e185b97b4364063f1135604b87f8d8469944233 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'arch/x86_64/kernel/pci-gart.c')
-rw-r--r--arch/x86_64/kernel/pci-gart.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 88be97c9698..2e28e855ec3 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -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)
@@ -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;