Commit:     8154549cb8ca795cbefda404cd6120398e5b145f
Parent:     1a2b73302aacddf2543f9d7a25936e4323fa1486
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 15 02:40:34 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Aug 18 10:25:25 2007 -0700

    x86_64: Fail dma_alloc_coherent on dma less devices
    This should fix an oops with PCMCIA PATA devices
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 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 05d745e..2971144 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,
        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;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to