[3/3] Use the DMA32 zone for dma_alloc_coherent()/pci_alloc_consistent on x86-64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the DMA32 zone for dma_alloc_coherent()/pci_alloc_consistent on x86-64

Signed-off-by: Andi Kleen <[email protected]>

Index: linux/arch/x86_64/kernel/pci-gart.c
===================================================================
--- linux.orig/arch/x86_64/kernel/pci-gart.c
+++ linux/arch/x86_64/kernel/pci-gart.c
@@ -219,6 +219,8 @@ dma_alloc_coherent(struct device *dev, s
 	/* Kludge to make it bug-to-bug compatible with i386. i386
 	   uses the normal dma_mask for alloc_coherent. */
 	dma_mask &= *dev->dma_mask;
+	if (dma_mask <= 0xffffffff)
+		gfp |= GFP_DMA32;
 
  again:
 	memory = dma_alloc_pages(dev, gfp, get_order(size));
@@ -245,7 +247,7 @@ dma_alloc_coherent(struct device *dev, s
 				}
 
 				if (!(gfp & GFP_DMA)) { 
-					gfp |= GFP_DMA; 
+					gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
 					goto again;
 				}
 				return NULL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux