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


Groups > linux.kernel > #1426315

Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget

From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget
Date 2016-06-20 10:20 +0200
Message-ID <rM2B3-5Mx-5@gated-at.bofh.it> (permalink)
References <rKZlU-5mE-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Baolin Wang <baolin.wang@linaro.org> writes:

> It will be crash to stop gadget when the dwc3 device had been into suspend
> state, thus we need to check if the dwc3 device had been into suspend state
> when UDC try to stop gadget.
>
> By the way I have rebased on your 'testing/next' branch.

do you really want this note to be in commit log? Seems like this should
be after tearline below.

>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
>  drivers/usb/dwc3/gadget.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 6dde376..351769e 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1791,6 +1791,9 @@ err0:
>  
>  static void __dwc3_gadget_stop(struct dwc3 *dwc)
>  {
> +	if (pm_runtime_suspended(dwc->dev))
> +		return;
> +
>  	dwc3_gadget_disable_irq(dwc);
>  	__dwc3_gadget_ep_disable(dwc->eps[0]);
>  	__dwc3_gadget_ep_disable(dwc->eps[1]);
> -- 
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

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


Thread

[PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-06-17 12:40 +0200
  Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget Felipe Balbi <balbi@kernel.org> - 2016-06-20 10:20 +0200
    Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when  stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-06-20 10:20 +0200

csiph-web