On Thu, 15 Dec 2011, Felipe Balbi wrote: > > > + if (req->dma == DMA_ADDR_INVALID) { > > > > What's the purpose of this test? Just to catch UDC drivers that try to > > map a request twice in a row? If that's the case, then why not provide > > an error message when it happens? > > The thing is that there has never been an agreement of who will do the > final mapping on the Gadget Framework. Look at all UDCs and you'll see > that they all have the same checks. > > We can add such a requirement now, but I'm afraid we could have > out-of-tree gadget-drivers relying on dma_alloc_coherent() which would > already give a request with a valid dma address. Or gadget drivers > actually deciding to call dma_map_*() APIs. Okay, I see. > If more people would be willing to accept that possibility, I'm very > eager to change the patch so that it would assume we have an unmapped > request always. What do you say ? I'm not too concerned about breaking out-of-tree drivers. After all, the kernel doesn't have a stable internal ABI. Have you checked the in-tree drivers? I haven't. You could start off easy by leaving in the test and doing WARN_ONCE if the DMA address is already set. Then if nothing shows up in kerneloops, take it out entirely. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html