Re: [PATCH V2] usb: musb: host: Unmap the buffer for PIO data transfers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Aug 2010, 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.

Generally okay, but a few small things should be fixed.

> Signed-off-by: Maulik Mankad <x0082077@xxxxxx>
> Cc: Felipe Balbi <felipe.balbi@xxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> ---
> Based on 2.6.36-rc1
>  drivers/usb/core/hcd.c       |    3 ++-
>  drivers/usb/musb/musb_host.c |    5 +++++
>  drivers/usb/musb/musb_host.h |    1 +
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> Index: mainline/drivers/usb/core/hcd.c
> ===================================================================
> --- mainline.orig/drivers/usb/core/hcd.c
> +++ mainline/drivers/usb/core/hcd.c
> @@ -1263,7 +1263,7 @@ static void hcd_free_coherent(struct usb
>  	*dma_handle = 0;
>  }
>  
> -static void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
> +void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
>  {
>  	enum dma_data_direction dir;
>  
> @@ -1307,6 +1307,7 @@ static void unmap_urb_for_dma(struct usb
>  			URB_DMA_MAP_SG | URB_DMA_MAP_PAGE |
>  			URB_DMA_MAP_SINGLE | URB_MAP_LOCAL);
>  }
> +EXPORT_SYMBOL(unmap_urb_for_dma);

This should be EXPORT_SYMBOL_GPL, like the other EXPORTs in this source
file.

...

> Index: mainline/drivers/usb/musb/musb_host.h
> ===================================================================
> --- mainline.orig/drivers/usb/musb/musb_host.h
> +++ mainline/drivers/usb/musb/musb_host.h
> @@ -83,6 +83,7 @@ static inline struct musb_qh *first_qh(s
>  
>  
>  extern void musb_root_disconnect(struct musb *musb);
> +extern void unmap_urb_for_dma(struct usb_hcd *, struct urb *);

This line does not belong here.  It should go in 
include/linux/usb/hcd.h.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux