[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lgxsvi7v.fsf@linux.intel.com>
Date: Thu, 13 Oct 2016 10:08:52 +0300
From: Felipe Balbi <balbi@...nel.org>
To: Baolin Wang <baolin.wang@...aro.org>
Cc: gregkh@...uxfoundation.org, broonie@...nel.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
baolin.wang@...aro.org
Subject: Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget
Hi,
Baolin Wang <baolin.wang@...aro.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
Download attachment "signature.asc" of type "application/pgp-signature" (801 bytes)
Powered by blists - more mailing lists