On Fri, 2007-08-10 at 00:17 +0100, Alan Cox wrote: > > If the device you're passing has a NULL dma_mask pointer that means the > > platform hasn't set it up correctly for dma ... and that's the > > Well it may not do DMA. Unfortunately, I don't think we've considered that possibility in the integration of the dma API and generic devices. > > underlying problem (although it's not necessarily a libata problem): you > > can't call dma_ operations on a device that hasn't been set up in the > > platform for it. > > Right. > > Ok so what is the right way given a random *correctly* set up device that > may or may not be DMA capable to determine this. Its an arbitary device > pointer for an arbitary device class on an arbitary platform which may or > may not support DMA for this device class ? > > Can I called dma_alloc_coherent and get a NULL back or do we need a > device_can_dma() check in each platform ? Fundamentally it's a different question. The dma_alloc is just saying can you set up a coherent memory area that this device can reach. Often the platform cannot necessarily discover this. I'd say the best signal is that the driver has called dma_set_mask(dev, DMA_MASK_NONE) (which isn't defined yet). So the platform has a signal that the device isn't DMA capable. James - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html