Hi,

On Wed, Oct 10, 2012 at 07:17:58PM -0700, Kuninori Morimoto wrote:
> This patch enabled dma mapping, and used dma transfer handler
> on mod_host
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
> ---
> Felipe
> 
> I sent some patches before, and I guess it will go to v3.8 branch.
> please let me know if you want me to resend these.
> 
>  drivers/usb/renesas_usbhs/mod_host.c |   17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/mod_host.c 
> b/drivers/usb/renesas_usbhs/mod_host.c
> index 9b69a13..e856b44 100644
> --- a/drivers/usb/renesas_usbhs/mod_host.c
> +++ b/drivers/usb/renesas_usbhs/mod_host.c
> @@ -681,9 +681,9 @@ static int usbhsh_queue_push(struct usb_hcd *hcd,
>       }
>  
>       if (usb_pipein(urb->pipe))
> -             pipe->handler = &usbhs_fifo_pio_pop_handler;
> +             pipe->handler = &usbhs_fifo_dma_pop_handler;
>       else
> -             pipe->handler = &usbhs_fifo_pio_push_handler;
> +             pipe->handler = &usbhs_fifo_dma_push_handler;
>  
>       buf = (void *)(urb->transfer_buffer + urb->actual_length);
>       len = urb->transfer_buffer_length - urb->actual_length;
> @@ -916,6 +916,19 @@ static int usbhsh_dcp_queue_push(struct usb_hcd *hcd,
>   */
>  static int usbhsh_dma_map_ctrl(struct usbhs_pkt *pkt, int map)
>  {
> +     if (map) {
> +             struct usbhsh_request *ureq = usbhsh_pkt_to_ureq(pkt);
> +             struct urb *urb = ureq->urb;
> +
> +             /* it can not use scatter/gather */
> +             if (urb->num_sgs)
> +                     return -EINVAL;

I'm not the most knowledgeable on the host stack, but is this really
necessary ? Isn't host stack supposed to check sg_tablesize and handle
that properly ?

Alan ? Greg ?

> +             pkt->dma = urb->transfer_dma;
> +             if (!pkt->dma)
> +                     return -EINVAL;
> +     }
> +
>       return 0;
>  }
>  
> -- 
> 1.7.9.5
> 

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to