Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91035
b: refs/heads/master
c: 45a07e7
h: refs/heads/master
i:
  91033: 8b0ac5d
  91031: 3711481
v: v3
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Apr 19, 2008
1 parent d740062 commit 1d777df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1a079029036881375110f78df47d352e7c28a77
refs/heads/master: 45a07e774950ef479f8996c0e2c5550dd6440453
13 changes: 13 additions & 0 deletions trunk/arch/x86/kernel/pci-dma_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
#include <linux/module.h>
#include <asm/io.h>

/* Dummy device used for NULL arguments (normally ISA). Better would
be probably a smaller DMA mask, but this is bug-to-bug compatible
to i386. */
struct device fallback_dev = {
.bus_id = "fallback device",
.coherent_dma_mask = DMA_32BIT_MASK,
.dma_mask = &fallback_dev.coherent_dma_mask,
};


static int dma_alloc_from_coherent_mem(struct device *dev, ssize_t size,
dma_addr_t *dma_handle, void **ret)
{
Expand Down Expand Up @@ -75,6 +85,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
gfp |= GFP_DMA;

if (!dev)
dev = &fallback_dev;

page = dma_alloc_pages(dev, gfp, order);
if (page == NULL)
return NULL;
Expand Down

0 comments on commit 1d777df

Please sign in to comment.