lkml.org 
[lkml]   [2003]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: USB and DMA on Alpha with 2.6.0-test7
On Fri, Oct 10, 2003 at 12:43:24PM -0700, David Brownell wrote:
> 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;
> }

This doesn't work. You will always return success if mask = ~0ULL.
But more important thing is that dma_supported() must not expect
valid *dev->dma_mask, as it's called from dma_set_mask().
That is, your usage of dma_supported() is buggy regardless of
DMA API implementation.

Ivan.
-
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:49    [W:0.074 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site