aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/pci-dma.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-05-17 11:12:24 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-17 11:12:24 -0400
commit538f0fd0f210c2ce5c585799f18d0e5c7cf6155e (patch)
treee9fa2b10ce5d92ac6bcd8ac55af1cd97bda3ec5d /arch/x86/kernel/pci-dma.c
parent3bb6fbf9969a8bbe4892968659239273d092e78a (diff)
parentf26a3988917913b3d11b2bd741601a2c64ab9204 (diff)
Merge branch 'linus' into x86/gart
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r--arch/x86/kernel/pci-dma.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 81862d0c7a9a..7747bc82b11d 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -386,11 +386,13 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
386 if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory)) 386 if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory))
387 return memory; 387 return memory;
388 388
389 if (!dev) 389 if (!dev) {
390 dev = &fallback_dev; 390 dev = &fallback_dev;
391 gfp |= GFP_DMA;
392 }
391 dma_mask = dev->coherent_dma_mask; 393 dma_mask = dev->coherent_dma_mask;
392 if (dma_mask == 0) 394 if (dma_mask == 0)
393 dma_mask = DMA_32BIT_MASK; 395 dma_mask = (gfp & GFP_DMA) ? DMA_24BIT_MASK : DMA_32BIT_MASK;
394 396
395 /* Device not DMA able */ 397 /* Device not DMA able */
396 if (dev->dma_mask == NULL) 398 if (dev->dma_mask == NULL)
@@ -404,7 +406,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
404 larger than 16MB and in this case we have a chance of 406 larger than 16MB and in this case we have a chance of
405 finding fitting memory in the next higher zone first. If 407 finding fitting memory in the next higher zone first. If
406 not retry with true GFP_DMA. -AK */ 408 not retry with true GFP_DMA. -AK */
407 if (dma_mask <= DMA_32BIT_MASK) 409 if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
408 gfp |= GFP_DMA32; 410 gfp |= GFP_DMA32;
409#endif 411#endif
410 412