On Fri, 12 Mar 2010, Pete Zaitcev wrote: > On Thu, 11 Mar 2010 18:53:16 -0500 (EST) > Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > > Although usbmon _is_ called after unmap_urb_for_dma(), that's not where > > the unmapping actually takes place! Transfers coming through the > > scatter-gather library are unmapped when sg_clean() in message.c calls > > usb_buffer_unmap_sg(), which doesn't happen until after the entire > > transfer is complete. > > > Offhand, I can't think how to fix this. I'm open to suggestions. > > I don't know either. > > I suppose we could go back to insane tricks with taking the DMA address > and then converting it into some kind of virtual address. But that > opens us to problems of that approach (e.g. oops on Opteron or trying > to add a method to all IOMMUs that does this). Maybe we could have the scatter-gather library put pointers to the scatterlist elements in the URBs, and then for each URB have usbmon call dma_sync_sg() with nelems set to 1 (see Documentation/DMA-API.txt). I'm not sure whether this will work properly if the original scatter-gather list contained more than one element, but it probably will. I can ask. Does that sound workable? 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