diff options
author | Andi Kleen <ak@suse.de> | 2007-08-14 20:40:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-18 13:25:25 -0400 |
commit | 8154549cb8ca795cbefda404cd6120398e5b145f (patch) | |
tree | a4538b4ee409403582d80aa02b509b7c92dc299c | |
parent | 1a2b73302aacddf2543f9d7a25936e4323fa1486 (diff) |
x86_64: Fail dma_alloc_coherent on dma less devices
This should fix an oops with PCMCIA PATA devices
http://bugzilla.kernel.org/show_bug.cgi?id=8424
This is not a full fix for the problem, but probably
still the right thing to do.
[ I'm almost certain it's *not* the right thing to do, but it avoids an
oops, and I want comments from others on what the right thing would
actually be.. I suspect we should just remove the use of dma_mask
entirely in this function, and just use coherent_dma_mask. - Linus ]
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86_64/kernel/pci-dma.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index 05d745ede561..29711445c818 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c | |||
@@ -82,6 +82,10 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
82 | if (dma_mask == 0) | 82 | if (dma_mask == 0) |
83 | dma_mask = DMA_32BIT_MASK; | 83 | dma_mask = DMA_32BIT_MASK; |
84 | 84 | ||
85 | /* Device not DMA able */ | ||
86 | if (dev->dma_mask == NULL) | ||
87 | return NULL; | ||
88 | |||
85 | /* Don't invoke OOM killer */ | 89 | /* Don't invoke OOM killer */ |
86 | gfp |= __GFP_NORETRY; | 90 | gfp |= __GFP_NORETRY; |
87 | 91 | ||