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


Groups > linux.kernel > #1375732 > unrolled thread

[PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

Started byRoger Quadros <rogerq@ti.com>
First post2016-04-11 13:40 +0200
Last post2016-04-12 10:30 +0200
Articles 7 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 13:40 +0200
    Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-11 14:30 +0200
      Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 15:20 +0200
        Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-11 15:30 +0200
          Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-11 16:00 +0200
            Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode Felipe Balbi <balbi@kernel.org> - 2016-04-12 10:10 +0200
              Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during  dual-role mode Roger Quadros <rogerq@ti.com> - 2016-04-12 10:30 +0200

#1375732 — [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

FromRoger Quadros <rogerq@ti.com>
Date2016-04-11 13:40 +0200
Subject[PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode
Message-ID<rmIme-57L-23@gated-at.bofh.it>
Gadget controller might not be always active during suspend/
resume when we are operating in dual-role/otg mode.
Check if we're active and only if we are then perform
necessary actions during suspend/resume.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/dwc3/gadget.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 83d5c57..1ca5ac0 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2952,6 +2952,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
 
 int dwc3_gadget_suspend(struct dwc3 *dwc)
 {
+	if (!dwc->gadget_driver)
+		return 0;
+
 	if (dwc->pullups_connected) {
 		dwc3_gadget_disable_irq(dwc);
 		dwc3_gadget_run_stop(dwc, true, true);
@@ -2970,6 +2973,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
 	struct dwc3_ep		*dep;
 	int			ret;
 
+	if (!dwc->gadget_driver)
+		return 0;
+
 	/* Start with SuperSpeed Default */
 	dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1375772

FromFelipe Balbi <balbi@kernel.org>
Date2016-04-11 14:30 +0200
Message-ID<rmJ8C-5Ts-7@gated-at.bofh.it>
In reply to#1375732

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

Hi,

Roger Quadros <rogerq@ti.com> writes:
> Gadget controller might not be always active during suspend/
> resume when we are operating in dual-role/otg mode.
> Check if we're active and only if we are then perform
> necessary actions during suspend/resume.

I don't get this. If we're operating in OTG, we should have a gadget
driver loaded, no ?

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1375827 — Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

FromRoger Quadros <rogerq@ti.com>
Date2016-04-11 15:20 +0200
SubjectRe: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode
Message-ID<rmJUZ-6uN-1@gated-at.bofh.it>
In reply to#1375772
On 11/04/16 15:23, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros <rogerq@ti.com> writes:
>> Gadget controller might not be always active during suspend/
>> resume when we are operating in dual-role/otg mode.
>> Check if we're active and only if we are then perform
>> necessary actions during suspend/resume.
> 
> I don't get this. If we're operating in OTG, we should have a gadget
> driver loaded, no ?
> 
At boot gadget driver is not automatically loaded. We're still in OTG mode
but OTG state machine hasn't started.
System suspend/resume can still happen.

User might also load/unload the gadget driver prior to system suspend.

cheers,
-roger

[toc] | [prev] | [next] | [standalone]


#1375846

FromFelipe Balbi <balbi@kernel.org>
Date2016-04-11 15:30 +0200
Message-ID<rmK4H-6zt-33@gated-at.bofh.it>
In reply to#1375827

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

Hi,

Roger Quadros <rogerq@ti.com> writes:
> On 11/04/16 15:23, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> Roger Quadros <rogerq@ti.com> writes:
>>> Gadget controller might not be always active during suspend/
>>> resume when we are operating in dual-role/otg mode.
>>> Check if we're active and only if we are then perform
>>> necessary actions during suspend/resume.
>> 
>> I don't get this. If we're operating in OTG, we should have a gadget
>> driver loaded, no ?
>> 
> At boot gadget driver is not automatically loaded. We're still in OTG mode
> but OTG state machine hasn't started.
> System suspend/resume can still happen.
>
> User might also load/unload the gadget driver prior to system suspend.

good point, this should go in the -rc too.

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1375968 — Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

FromRoger Quadros <rogerq@ti.com>
Date2016-04-11 16:00 +0200
SubjectRe: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode
Message-ID<rmKxN-6PH-97@gated-at.bofh.it>
In reply to#1375846
On 11/04/16 16:26, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros <rogerq@ti.com> writes:
>> On 11/04/16 15:23, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Roger Quadros <rogerq@ti.com> writes:
>>>> Gadget controller might not be always active during suspend/
>>>> resume when we are operating in dual-role/otg mode.
>>>> Check if we're active and only if we are then perform
>>>> necessary actions during suspend/resume.
>>>
>>> I don't get this. If we're operating in OTG, we should have a gadget
>>> driver loaded, no ?
>>>
>> At boot gadget driver is not automatically loaded. We're still in OTG mode
>> but OTG state machine hasn't started.
>> System suspend/resume can still happen.
>>
>> User might also load/unload the gadget driver prior to system suspend.
> 
> good point, this should go in the -rc too.
> 
But there is no dual-role mode currently so it won't fix any bug yet :).

cheers,
-roger

[toc] | [prev] | [next] | [standalone]


#1376539

FromFelipe Balbi <balbi@kernel.org>
Date2016-04-12 10:10 +0200
Message-ID<rn1yy-3Sy-13@gated-at.bofh.it>
In reply to#1375968

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

Hi,

Roger Quadros <rogerq@ti.com> writes:
> On 11/04/16 16:26, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> Roger Quadros <rogerq@ti.com> writes:
>>> On 11/04/16 15:23, Felipe Balbi wrote:
>>>>
>>>> Hi,
>>>>
>>>> Roger Quadros <rogerq@ti.com> writes:
>>>>> Gadget controller might not be always active during suspend/
>>>>> resume when we are operating in dual-role/otg mode.
>>>>> Check if we're active and only if we are then perform
>>>>> necessary actions during suspend/resume.
>>>>
>>>> I don't get this. If we're operating in OTG, we should have a gadget
>>>> driver loaded, no ?
>>>>
>>> At boot gadget driver is not automatically loaded. We're still in OTG mode
>>> but OTG state machine hasn't started.
>>> System suspend/resume can still happen.
>>>
>>> User might also load/unload the gadget driver prior to system suspend.
>> 
>> good point, this should go in the -rc too.
>> 
> But there is no dual-role mode currently so it won't fix any bug yet :).

this should be a problem even for device-only, right ?

i) boot-up
ii) modprobe dwc3
iii) echo mem > /sys/power/state

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1376557 — Re: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode

FromRoger Quadros <rogerq@ti.com>
Date2016-04-12 10:30 +0200
SubjectRe: [PATCH v6 07/10] usb: dwc3: gadget: Fix suspend/resume during dual-role mode
Message-ID<rn1RV-421-35@gated-at.bofh.it>
In reply to#1376539
On 12/04/16 11:00, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros <rogerq@ti.com> writes:
>> On 11/04/16 16:26, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Roger Quadros <rogerq@ti.com> writes:
>>>> On 11/04/16 15:23, Felipe Balbi wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Roger Quadros <rogerq@ti.com> writes:
>>>>>> Gadget controller might not be always active during suspend/
>>>>>> resume when we are operating in dual-role/otg mode.
>>>>>> Check if we're active and only if we are then perform
>>>>>> necessary actions during suspend/resume.
>>>>>
>>>>> I don't get this. If we're operating in OTG, we should have a gadget
>>>>> driver loaded, no ?
>>>>>
>>>> At boot gadget driver is not automatically loaded. We're still in OTG mode
>>>> but OTG state machine hasn't started.
>>>> System suspend/resume can still happen.
>>>>
>>>> User might also load/unload the gadget driver prior to system suspend.
>>>
>>> good point, this should go in the -rc too.
>>>
>> But there is no dual-role mode currently so it won't fix any bug yet :).
> 
> this should be a problem even for device-only, right ?
> 
> i) boot-up
> ii) modprobe dwc3
> iii) echo mem > /sys/power/state
> 
Indeed. It is applicable for device-only mode as well. I'll send this patch for rc then.

cheers,
-roger

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web