Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91040
b: refs/heads/master
c: da60cab
h: refs/heads/master
v: v3
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Apr 19, 2008
1 parent 20c1496 commit b4718f0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa99b16faadcc9a5b6bd9550fda117a8e9e46d26
refs/heads/master: da60cab4dd922cd933e82bace490f6155a32a90e
34 changes: 32 additions & 2 deletions trunk/arch/x86/kernel/pci-dma_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,42 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
goto again;
}

/* Let low level make its own zone decisions */
gfp &= ~(GFP_DMA32|GFP_DMA);

if (dma_ops->alloc_coherent)
return dma_ops->alloc_coherent(dev, size,
dma_handle, gfp);
return NULL;

}
memset(ret, 0, size);
*dma_handle = bus;
if (!mmu) {
*dma_handle = bus;
return ret;
}
}

if (dma_ops->alloc_coherent) {
free_pages((unsigned long)ret, get_order(size));
gfp &= ~(GFP_DMA|GFP_DMA32);
return dma_ops->alloc_coherent(dev, size, dma_handle, gfp);
}

if (dma_ops->map_simple) {
*dma_handle = dma_ops->map_simple(dev, virt_to_phys(ret),
size,
PCI_DMA_BIDIRECTIONAL);
if (*dma_handle != bad_dma_address)
return ret;
}

return ret;
if (panic_on_overflow)
panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n",
(unsigned long)size);
free_pages((unsigned long)ret, get_order(size));
return NULL;
}
EXPORT_SYMBOL(dma_alloc_coherent);

Expand Down

0 comments on commit b4718f0

Please sign in to comment.