Hi,

On Thu, Feb 28, 2013 at 04:51:29PM +0530, Pratyush Anand wrote:
> On 2/28/2013 4:18 PM, Felipe Balbi wrote:
> >>+   if (list_empty(&dep->req_queued))
> >>>+          dep->flags &= ~DWC3_EP_BUSY;
> >not sure this is correct. Whenever req_queue isn't empty, we call
> >dwc3_stop_active_transfer() which will clear DWC3_EP_BUSY flag.
> 
> Yes, if we clear DWC3_EP_BUSY  in dwc3_stop_active_transfer then its
> fine. But we do not do that. Probably , error was introduced when
> "End Transfer" completion interrupt handling was removed.


> static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
>               struct usb_request *request)
> {

[...]

>       if (r != req) {
>               list_for_each_entry(r, &dep->req_queued, list) {
>                       if (r == req)
>                               break;
>               }
>               if (r == req) {
>                       /* wait until it is processed */
>                       dwc3_stop_active_transfer(dwc, dep->number);

                        ^
                        look here

>                       goto out1;
>               }
>               dev_err(dwc->dev, "request %p was not queued to %s\n",
>                               request, ep->name);
>               ret = -EINVAL;
>               goto out0;
>       }
> 
> out1:
>       /* giveback the request */
>       dwc3_gadget_giveback(dep, req, -ECONNRESET);
> 
> out0:
>       spin_unlock_irqrestore(&dwc->lock, flags);
> 
>       return ret;
> }
> 
> static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
> {

[...]

>       cmd = DWC3_DEPCMD_ENDTRANSFER;
>       cmd |= DWC3_DEPCMD_HIPRI_FORCERM | DWC3_DEPCMD_CMDIOC;
>       cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
>       memset(&params, 0, sizeof(params));
>       ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
>       WARN_ON_ONCE(ret);
>       dep->resource_index = 0;
>       dep->flags &= ~DWC3_EP_BUSY;

        ^
        and here

>       udelay(100);
> }

??

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to