Re: [PATCH V3] usb: dwc3: Handle pending control data out correctly

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

On Thu, May 03, 2012 at 07:05:05PM +0530, Pratyush Anand wrote:
> If transfer not ready is received before ep_queue is called for control
> out transfer then pending flag is set. Handling of this case was not
> correct.
> TRB size must be multiple of maxpacket for all control out transfer.
> dma sync function should also be called before start transfer.
> A routine to delegate transfer for control data has been extracted out
> from dwc3_ep0_do_control_data. Same routine has been called from
> ep_queue too in case of pending flag is set.
> Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---
>  drivers/usb/dwc3/ep0.c |   90 +++++++++++++++++++++++++----------------------
>  1 files changed, 48 insertions(+), 42 deletions(-)
> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
> index 1f917d9..f0c5f85 100644
> --- a/drivers/usb/dwc3/ep0.c
> +++ b/drivers/usb/dwc3/ep0.c
> @@ -119,6 +119,49 @@ static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, dma_addr_t buf_dma,
>  	return 0;
>  }
> +static int dwc3_ep0_start_data_trans(struct dwc3 *dwc,
> +		struct dwc3_request *req)
> +{
> +	u32 transfer_size = req->request.length;
> +	struct dwc3_ep *dep = dwc->eps[0];

you can't hardcode this to ep0. Physical endpoint 0 is *ONLY* for OUT
direction. physical endpoint 1 is *ONLY* for in direction.

I have a patch ready moving the code around, will test it and send it


Attachment: signature.asc
Description: Digital signature

B and H Foto and Electronics Corp.

[Linux Media]     [Video for Linux]     [Linux Input]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]     [More Archives]

Add to Google Powered by Linux