Hi Minas, On Mon, Dec 24, 2018 at 12:41 AM Minas Harutyunyan <minas.harutyunyan@xxxxxxxxxxxx> wrote: > > > > > With DEBUG defined in dwc2/core_intr.c I get: > > > > #unplugging > > [ 364.111260] dwc2 ffb00000.usb: GINTSTS_ErlySusp > > [ 364.115831] dwc2 ffb00000.usb: gintsts=04008828 gintmsk=d08c3cc4 > > [ 364.121906] dwc2 ffb00000.usb: USB SUSPEND > > [ 364.125994] dwc2 ffb00000.usb: dwc2_handle_usb_suspend_intr: DSTS=0x3cf701 > > [ 364.132844] dwc2 ffb00000.usb: DSTS.Suspend Status=1 HWCFG4.Power > > Optimize=0 HWCFG4.Hibernation=0 > > > You didn't see dummy USBRst interrupt on disconnect, follow to above > interrupts? > No, I only see the suspend interrupt when pulling the plug. The USBRst happens after plugging back in. It's actually not a problem for my use case if the device just appears suspended while the cable is disconnected, the problem is when the cable is plugged back in and the device still appears to be suspended. So it's ok if the gadget disconnect doesn't happen until I plug back in. Locally, I've addressed the problem by making the gadget/composite.c clear cdev->suspended in its gadget reset/disconnect handler. I also made dwc2 generate gadget reset events, just because they seemed to have been overlooked (libcomposite uses the same handler for disconnect and reset so it doesn't make much difference in my case). One other fact that may be relevant, I'm using a normal A/B usb cable, not an OTG cable. So maybe that takes the OTG HNP and SRP protocols our of play and suppresses the session end interrupt? > > > #plugging back in > > [ 526.407546] dwc2 ffb00000.usb: EnumDone (DSTS=0x003cf000) > > [ 526.412936] dwc2 ffb00000.usb: new device is high-speed > > [ 526.470634] dwc2 ffb00000.usb: GINTSTS_ErlySusp > > [ 526.475204] dwc2 ffb00000.usb: dwc2_hsotg_irq: USBRst > > [ 526.527561] dwc2 ffb00000.usb: EnumDone (DSTS=0x000e0000) > > [ 526.532953] dwc2 ffb00000.usb: new device is high-speed > > [ 526.587560] dwc2 ffb00000.usb: new address 6 > > [ 526.620544] g_serial gadget: high-speed config #2: CDC ACM config > > -- Frank