Skip to content

Commit

Permalink
x86_64: Fail dma_alloc_coherent on dma less devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Aug 18, 2007
1 parent 1a2b733 commit 8154549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86_64/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
if (dma_mask == 0)
dma_mask = DMA_32BIT_MASK;

/* Device not DMA able */
if (dev->dma_mask == NULL)
return NULL;

/* Don't invoke OOM killer */
gfp |= __GFP_NORETRY;

Expand Down

0 comments on commit 8154549

Please sign in to comment.