> -----Original Message----- > From: John Youn [mailto:John.Youn@xxxxxxxxxxxx] > Sent: Wednesday, March 18, 2015 8:14 PM > To: Kaukab, Yousaf; John Youn; linux-usb@xxxxxxxxxxxxxxx; balbi@xxxxxx > Cc: Herrero, Gregory; r.baldyga@xxxxxxxxxxx; > dinguyen@xxxxxxxxxxxxxxxxxxxxx; zhangfei.gao@xxxxxxxxxx > Subject: Re: [PATCH v1 00/20] usb: third series of updates for dwc2 driver > > On 3/18/2015 8:45 AM, Kaukab, Yousaf wrote: > > > > > >> -----Original Message----- > >> From: John Youn [mailto:John.Youn@xxxxxxxxxxxx] > >> Sent: Wednesday, March 18, 2015 3:33 AM > >> To: Kaukab, Yousaf; linux-usb@xxxxxxxxxxxxxxx; balbi@xxxxxx; > >> john.youn@xxxxxxxxxxxx > >> Cc: Herrero, Gregory; r.baldyga@xxxxxxxxxxx; > >> dinguyen@xxxxxxxxxxxxxxxxxxxxx; zhangfei.gao@xxxxxxxxxx > >> Subject: Re: [PATCH v1 00/20] usb: third series of updates for dwc2 > >> driver > >> > >> On 3/17/2015 2:54 AM, Mian Yousaf Kaukab wrote: > >>> Hi, > >>> This patchset consists of some bug fixes and feature enhancements > >>> for the dwc2 driver. All the patches are verified on dwc2 v3.0a with > >>> dedicated fifos. Main focus of testing was with dma enabled. > >>> Although basic testing without dma was also done. > >>> > >>> This is based on testing/next branch in Felipe's git. > >>> > >>> Thank you, > >>> > >>> Best regards, > >>> Yousaf > >>> > >> > >> Hi Yousaf, > >> > >> Patch 15 and 16 introduce regressions in two systems that I tested with. > > > > :( sorry for that. I will try to fix this asap. > > > >> > >> After patch 15, the host fails to work at all. > > > > My understanding is that functionality can break within the patchset but it > should build at any point. If that's not correct, is merging patch 15 and 16 OK > for you? > > > > Ok that's fine. Just thought I'd point out where the breakage started. > > > >> > >> After patch 16, the host works but the device fails enumeration > >> whenever switching from an A to B cable, going from host to > >> peripheral. After this fails, if you unplug and replug the B cable it > >> will enumerate. But whenever you switch from A to B it always fails. > >> > >> Tested on a Synopsys (2.94a) and Altera (2.93a) system. > >> > >> I don't have any logs right now but I can get those tomorrow if you need > them. > > > > It will be very helpful if you can provide log after > CONFUG_USB_DWC2_DEBUG enabled and also function trace of dwc2 driver. > > > > Logs attached. First is device connection after driver load. Second is after role > switch. > > Seems to fail both times with similar error. > > Relevant snippet: > > [ 77.814073] dwc2 dwc2.1.auto: gintsts=44008020 gintmsk=d08c3cd4 > [ 77.814079] dwc2 dwc2.1.auto: ++Session Request Interrupt++ > [ 77.814091] dwc2 dwc2.1.auto: s3c_hsotg_irq: 04008020 00000000 > (d08c3cd4) retry 8 > [ 77.817097] dwc2 dwc2.1.auto: s3c_hsotg_irq: 04008420 00000400 > (d08c3cd4) retry 8 > [ 77.817102] dwc2 dwc2.1.auto: GINTSTS_ErlySusp > [ 77.820189] dwc2 dwc2.1.auto: gintsts=04008820 gintmsk=d08c3cd4 > [ 77.820194] dwc2 dwc2.1.auto: USB SUSPEND > [ 77.820202] dwc2 dwc2.1.auto: DSTS=0x3 > [ 77.820204] dwc2 dwc2.1.auto: DSTS.Suspend Status=1 HWCFG4.Power > Optimize=0 > [ 77.820213] dwc2 dwc2.1.auto: s3c_hsotg_irq: 04008020 00000000 > (d08c3cd4) retry 8 > [ 78.074297] dwc2 dwc2.1.auto: s3c_hsotg_irq: 04009020 00001000 > (d08c3cd4) retry 8 > [ 78.074305] dwc2 dwc2.1.auto: s3c_hsotg_irq: USBRst > [ 78.074310] dwc2 dwc2.1.auto: GNPTXSTS=00040400 > [ 78.074314] dwc2 dwc2.1.auto: complete: ep ffff8800d50ce618 ep0, req > ffff8800d524ae80, -104 => ffffffffa042be00 > [ 78.074317] dwc2 dwc2.1.auto: s3c_hsotg_complete_setup: failed -104 > [ 78.074326] dwc2 dwc2.1.auto: FIFOs reset, timeout at 100 > [ 78.074343] dwc2 dwc2.1.auto: EP0: DIEPCTL0=0x00008000, > DOEPCTL0=0x80008000 > [ 78.074347] dwc2 dwc2.1.auto: gsintmsk now 0xd08c3cc4 > [ 78.074351] dwc2 dwc2.1.auto: gsintmsk now 0xd08c3cd4 > [ 78.074361] dwc2 dwc2.1.auto: DCTL=0x00000000 > [ 78.074362] dwc2 dwc2.1.auto: s3c_hsotg_enqueue_setup: queueing setup > request > [ 78.074363] dwc2 dwc2.1.auto: ep0: req ffff8800d524ae80: > 8@ffff8801199df798, noi=0, zero=0, snok=0 > [ 78.074364] dwc2 dwc2.1.auto: s3c_hsotg_ep_queue: don't submit request > while suspended > [ 78.074365] dwc2 dwc2.1.auto: s3c_hsotg_enqueue_setup: failed queue (-11) > [ 78.074372] dwc2 dwc2.1.auto: EP0: DIEPCTL0=0x00008000, > DOEPCTL0=0x80008000 > [ 78.085364] dwc2 dwc2.1.auto: s3c_hsotg_irq: 04002020 00002000 > (d08c3cd4) retry 8 > [ 78.085372] dwc2 dwc2.1.auto: EnumDone (DSTS=0x00000000) > [ 78.085375] dwc2 dwc2.1.auto: new device is high-speed > [ 78.085415] dwc2 dwc2.1.auto: s3c_hsotg_enqueue_setup: queueing setup > request > [ 78.085416] dwc2 dwc2.1.auto: ep0: req ffff8800d524ae80: > 8@ffff8801199df798, noi=0, zero=0, snok=0 > [ 78.085417] dwc2 dwc2.1.auto: s3c_hsotg_ep_queue: don't submit request > while suspended > [ 78.085418] dwc2 dwc2.1.auto: s3c_hsotg_enqueue_setup: failed queue (-11) > [ 78.085424] dwc2 dwc2.1.auto: EP0: DIEPCTL0=0x00008000, > DOEPCTL0=0x80008000 Thank you for the traces. Lx_state is not being updated if vbus_session() is not called. So we need to set lx_state to L0 on B session valid. Can you please check if following patch helps: diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index e1e7ab7..54a1c11 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2515,6 +2515,7 @@ irq_retry: kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET); + hsotg->lx_state = DWC2_L0; s3c_hsotg_core_init_disconnected(hsotg, true); } } > > > John BR, Yousaf ��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥