Messages in this thread | | | Date | Sat, 11 Oct 2003 17:27:00 +0400 | From | Ivan Kokshaysky <> | Subject | Re: 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/
| |