lkml.org 
[lkml]   [2003]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: USB and DMA on Alpha with 2.6.0-test7
David Brownell wrote:
> The BUG_ON at include/asm-generic/dma-mapping.h:19 is a
> bug in that "generic DMA" code ... and I've seen the
> same BUG reported from PPC folk too.

Something like this should be correct even on x86, but
there may be some cases where a platform_dma_supported()
is necessary.

IMO this needs an all-architectures patch. Not many
will need a platform_dma_supported() ... but almost
every implementation of that simple call is broken.

- Dave


--- 1.4/include/asm-generic/dma-mapping.h Mon Jan 13 14:37:47 2003
+++ edited/include/asm-generic/dma-mapping.h Fri Oct 10 10:53:25 2003
@@ -13,12 +13,13 @@
/* need struct page definitions */
#include <linux/mm.h>

+/* FIXME use this everywhere there's no platform_dma_supported() */
static inline int
dma_supported(struct device *dev, u64 mask)
{
- BUG_ON(dev->bus != &pci_bus_type);
-
- return pci_dma_supported(to_pci_dev(dev), mask);
+ /* device can dma, using those address bits */
+ return dev->dma_mask
+ && (mask & *dev->dma_mask) == *dev->dma_mask;
}

static inline int
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.036 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site