]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'linus' into x86/gart
authorThomas Gleixner <tglx@linutronix.de>
Sat, 17 May 2008 15:12:24 +0000 (17:12 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 17 May 2008 15:12:24 +0000 (17:12 +0200)
1  2 
arch/x86/kernel/pci-dma.c

index 81862d0c7a9a9fa1ee1d5ce0f818b4b4bf361268,c5ef1af8e79de6883b005cfa99d59bb9164e978c..7747bc82b11d7d8c5d9f88109d544c17233d315f
@@@ -77,14 -77,10 +77,14 @@@ void __init dma32_reserve_bootmem(void
        if (end_pfn <= MAX_DMA32_PFN)
                return;
  
 +      /*
 +       * check aperture_64.c allocate_aperture() for reason about
 +       * using 512M as goal
 +       */
        align = 64ULL<<20;
        size = round_up(dma32_bootmem_size, align);
        dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
 -                               __pa(MAX_DMA_ADDRESS));
 +                               512ULL<<20);
        if (dma32_bootmem_ptr)
                dma32_bootmem_size = size;
        else
@@@ -92,6 -88,7 +92,6 @@@
  }
  static void __init dma32_free_bootmem(void)
  {
 -      int node;
  
        if (end_pfn <= MAX_DMA32_PFN)
                return;
@@@ -99,7 -96,9 +99,7 @@@
        if (!dma32_bootmem_ptr)
                return;
  
 -      for_each_online_node(node)
 -              free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),
 -                                dma32_bootmem_size);
 +      free_bootmem(__pa(dma32_bootmem_ptr), dma32_bootmem_size);
  
        dma32_bootmem_ptr = NULL;
        dma32_bootmem_size = 0;
@@@ -386,11 -385,13 +386,13 @@@ dma_alloc_coherent(struct device *dev, 
        if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory))
                return memory;
  
-       if (!dev)
+       if (!dev) {
                dev = &fallback_dev;
+               gfp |= GFP_DMA;
+       }
        dma_mask = dev->coherent_dma_mask;
        if (dma_mask == 0)
-               dma_mask = DMA_32BIT_MASK;
+               dma_mask = (gfp & GFP_DMA) ? DMA_24BIT_MASK : DMA_32BIT_MASK;
  
        /* Device not DMA able */
        if (dev->dma_mask == NULL)
           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 <= DMA_32BIT_MASK)
+       if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
                gfp |= GFP_DMA32;
  #endif