]> xenbits.xensource.com Git - people/royger/linux-2.6.18-xen.git/commitdiff
xen/x86: fix GFP mask handling in dma_alloc_coherent()
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 23 Oct 2009 09:07:22 +0000 (10:07 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 23 Oct 2009 09:07:22 +0000 (10:07 +0100)
Ever since no longer pushing all memory into the DMA zone (c/s 355),
explicitly setting GFP_DMA as well as not masking off GFP_DMA32 was
unnecessarily restricting the pool from which suitable memory could be
taken.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/kernel/pci-dma-xen.c

index a966c346e5b7de99806b56f8e18624e04c225b42..34316e7497379730bcccaa54a2ca3a7283bd7582 100644 (file)
@@ -218,7 +218,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
        u64 mask;
 
        /* ignore region specifiers */
-       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
+       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
 
        if (mem) {
                int page = bitmap_find_free_region(mem->bitmap, mem->size,
@@ -233,9 +233,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
                        return NULL;
        }
 
-       if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
-
        vstart = __get_free_pages(gfp, order);
        ret = (void *)vstart;