- 2.6.17 port work build breaks, but the patch set is relativly stable
[linux-flexiantxendom0-3.2.10.git] / arch / x86_64 / kernel / pci-dma.c
index 8d43ec6..a9275c9 100644 (file)
@@ -48,9 +48,11 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
 {
        struct page *page;
        int node;
+#ifdef CONFIG_PCI
        if (dev->bus == &pci_bus_type)
                node = pcibus_to_node(to_pci_dev(dev)->bus);
        else
+#endif
                node = numa_node_id();
 
        if (node < first_node(node_online_map))
@@ -77,6 +79,9 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
        if (dma_mask == 0)
                dma_mask = 0xffffffff;
 
+       /* Don't invoke OOM killer */
+       gfp |= __GFP_NORETRY;
+
        /* Kludge to make it bug-to-bug compatible with i386. i386
           uses the normal dma_mask for alloc_coherent. */
        dma_mask &= *dev->dma_mask;