> -----Original Message----- > From: David Vrabel [mailto:david.vrabel@xxxxxxx] > Sent: Tuesday, August 24, 2010 5:53 PM > To: Maulik Mankad > Cc: linux-usb@xxxxxxxxxxxxxxx; Felipe Balbi; Alan Stern > Subject: Re: [PATCH V2] usb: musb: host: Unmap the buffer for PIO data > transfers > > Maulik Mankad wrote: > > The USB stack maps the buffer for DMA if the controller supports DMA. > > MUSB controller can perform DMA as well as PIO transfers. > > The buffer needs to be unmapped before CPU can perform > > PIO data transfers. > > > > Export unmap_urb_for_dma() so that drivers can perform > > the DMA unmapping in a sane way. > > Don't you also need to remap it when the transfer is complete to prevent > usb core from unmapping something that's not mapped? > The USB core is intelligent enough not to unmap the buffer if it's already unmapped. As per my understanding when unmap_urb_for_dma()is called from usb_hcd_giveback_urb() path the urb->transfer_flags will indicate whether unmap is necessary or not. Thanks, Maulik -- 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