Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500059

Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget

From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget
Date 2016-10-13 09:20 +0200
Message-ID <srIt4-oQ-9@gated-at.bofh.it> (permalink)
References <sotAd-he-7@gated-at.bofh.it> <sotAd-he-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

Baolin Wang <baolin.wang@linaro.org> writes:
> @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
>  
>  	is_on = !!is_on;
>  
> +try_again:
>  	spin_lock_irqsave(&dwc->lock, flags);
>  	ret = dwc3_gadget_run_stop(dwc, is_on, false);
>  	spin_unlock_irqrestore(&dwc->lock, flags);
>  
> +	if (ret == -EBUSY) {
> +		ret = wait_for_completion_timeout(&dwc->ep0_in_setup,
> +						  msecs_to_jiffies(500));
> +		if (ret == 0) {
> +			dev_err(dwc->dev, "timeout to stop gadget.\n");
> +			ret = -ETIMEDOUT;
> +		} else {
> +			goto try_again;

you are not really reading my comments. It's the third time I tell you
there's no need for try_again. If you can't complete a control transfer
in 500ms, you already have other issues. Take this thing out of here.

-- 
balbi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-04 10:50 +0200
  Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget Felipe Balbi <balbi@kernel.org> - 2016-10-13 09:20 +0200
    Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer  completed when stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-13 10:00 +0200
      Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget Felipe Balbi <balbi@kernel.org> - 2016-10-13 10:00 +0200
        Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer  completed when stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-13 10:10 +0200

csiph-web