lkml.org 
[lkml]   [2003]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: pci_alloc_consistent() and/or dma_free_coherent() bug?
From
Date
Actually it would probably be better to do something like that:

--- arch/i386/kernel/pci-dma.c.orig 2003-05-27 03:00:25.000000000 +0200
+++ arch/i386/kernel/pci-dma.c 2003-08-05 18:55:42.000000000 +0200
@@ -20,7 +20,7 @@
/* ignore region specifiers */
gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

- if (dev == NULL || (*dev->dma_mask < 0xffffffff))
+ if (dev == NULL || ((*dev->consistent_dma_mask & *dev->dma_mask) < 0xffffffff))
gfp |= GFP_DMA;
ret = (void *)__get_free_pages(gfp, get_order(size));

So we don't need to touch pci_set*dma_mask and we don't need to call them
in specific order.
--
Krzysztof Halasa
Network Administrator
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.025 / U:2.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site