* [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget
@ 2016-06-17 10:37 Baolin Wang
2016-06-20 8:15 ` Felipe Balbi
0 siblings, 1 reply; 3+ messages in thread
From: Baolin Wang @ 2016-06-17 10:37 UTC (permalink / raw)
To: balbi, gregkh; +Cc: broonie, linux-usb, linux-kernel, baolin.wang
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.
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget
2016-06-17 10:37 [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget Baolin Wang
@ 2016-06-20 8:15 ` Felipe Balbi
2016-06-20 8:17 ` Baolin Wang
0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2016-06-20 8:15 UTC (permalink / raw)
To: Baolin Wang, gregkh; +Cc: broonie, linux-usb, linux-kernel, baolin.wang
[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget
2016-06-20 8:15 ` Felipe Balbi
@ 2016-06-20 8:17 ` Baolin Wang
0 siblings, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2016-06-20 8:17 UTC (permalink / raw)
To: Felipe Balbi; +Cc: Greg KH, Mark Brown, USB, LKML
On 20 June 2016 at 16:15, Felipe Balbi <balbi@kernel.org> wrote:
> 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.
Sorry. I'll remove this in next version. Thanks for your comment.
>
>>
>> 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
--
Baolin.wang
Best Regards
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-20 8:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 10:37 [PATCH] usb: dwc3: gadget: Add the suspend state checking when stopping gadget Baolin Wang
2016-06-20 8:15 ` Felipe Balbi
2016-06-20 8:17 ` Baolin Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).