Created attachment 151881 [details] Enabled DEBUG flag in files drivers/usb/core/hcd.c, drivers/usb/core/hub.c, drivers/usb/core/message.c, drivers/usb/host/xhci.c, xhci-ring.c, xhci-dbg.c, xhci-hub.c, xhci-mem.c, xhci-pci.c, xhci-plat. Host PC details: USB3.0 Hardware: TI's TUSB7340EVM xHCI host Software changes: Added Quirk to enable LPM for this card, some additional debug logs added Device Side: USB3.0 Hardware: Synopsys DWC3 controller, Camera sensor mounted on the platform Problem description: I have enabled LPM support for this xHCI card. My device also supports LPM. - When I insert webcam gadget module, the host controller stops responding. It dies after few seconds I have to restart the system in order to make it work again. - The webcam gadget has one configuration, 2 interfaces. Interface 0 has one Interrupt IN EP (wMaxPacketSize 16, bInterval 8). Interface 1 has one BULK IN EP (wMaxPacketSize 1024) - In USB protocol logs, I see SET_FEATURE U1_Enable and U2_Enable being sent by the host along with the values of exit latencies. - After that, I see CLEAR_FEATURE transaction for U1_Enable and U2_Enable. - Enabling/disabling autosuspend on host side has no additional impact on the behavior when the webcam is connected and LPM is enabled - When LPM is disabled, the webcam gadget works fine. - If I use gadget zero, then the xHCI host works well. The gadget zero has one interface having two EPs (BULK IN, BULK OUT) with wMaxPacketSize 1024. Please see the attached logs, I have enabled DEBUG flag in drivers/usb/core/hcd.c, drivers/usb/core/hub.c, drivers/usb/core/message.c, drivers/usb/host/xhci.c, xhci-ring.c, xhci-dbg.c, xhci-hub.c, xhci-mem.c, xhci-pci.c, xhci-plat.c Also, I have added some additional logs that might be helpful. Please let me know if anything further is required.
On Thu, Sep 25, 2014 at 10:48:05AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=85141 > > Bug ID: 85141 > Summary: XHCI host dies when LPM is enabled and webcam gadget > is connected Please send to the linux-usb@vger.kernel.org mailing list.
Sent. Thanks!
(In reply to Amit Virdi from comment #0) > Created attachment 151881 [details] > Enabled DEBUG flag in files drivers/usb/core/hcd.c, drivers/usb/core/hub.c, > drivers/usb/core/message.c, drivers/usb/host/xhci.c, xhci-ring.c, > xhci-dbg.c, xhci-hub.c, xhci-mem.c, xhci-pci.c, xhci-plat. > > Host PC details: > USB3.0 Hardware: TI's TUSB7340EVM xHCI host > Software changes: Added Quirk to enable LPM for this card, some additional > debug logs added > > Device Side: > USB3.0 Hardware: Synopsys DWC3 controller, Camera sensor mounted on the > platform > > Problem description: > I have enabled LPM support for this xHCI card. My device also supports LPM. > - When I insert webcam gadget module, the host controller stops responding. > It dies after few seconds I have to restart the system in order to make it > work again. > - The webcam gadget has one configuration, 2 interfaces. Interface 0 has > one Interrupt IN EP (wMaxPacketSize 16, bInterval 8). Interface 1 has one > BULK IN EP (wMaxPacketSize 1024) > - In USB protocol logs, I see SET_FEATURE U1_Enable and U2_Enable being > sent by the host along with the values of exit latencies. > - After that, I see CLEAR_FEATURE transaction for U1_Enable and U2_Enable. > - Enabling/disabling autosuspend on host side has no additional impact on > the behavior when the webcam is connected and LPM is enabled > - When LPM is disabled, the webcam gadget works fine. > - If I use gadget zero, then the xHCI host works well. The gadget zero has > one interface having two EPs (BULK IN, BULK OUT) with wMaxPacketSize 1024. > > Please see the attached logs, I have enabled DEBUG flag in > drivers/usb/core/hcd.c, drivers/usb/core/hub.c, drivers/usb/core/message.c, > drivers/usb/host/xhci.c, xhci-ring.c, xhci-dbg.c, xhci-hub.c, xhci-mem.c, > xhci-pci.c, xhci-plat.c > > Also, I have added some additional logs that might be helpful. Please let me > know if anything further is required. Debugging further, I see that once the host reads all the descriptors of the webcam gadget, it initiates SET_CONFIGURATION transfer. It then sends SET_SEL request for Ux SEL/PEL latencies and then enable the U1 and U2 features. Towards the end of usb_set_configuration, it tries to add interface (see the log "adding ... config #1, interface 0". At this point host tries to add/bind the driver. So, it issues command to configure the endpoint. This configure endpoint command times out and then stopping the command ring also fails.