Good Afternoon, So I have dug a bit further into it. The tegra-udc driver defaults to host mode when set to otg. If the tegra-udc driver is in host mode while plugged into another host, the kernel will hard lock. If the tegra-udc driver is in host mode with a device attached the device enumerates correctly. In this state, if you change the state to gadget, the driver goes into a broken state. The gadget side is in gadget mode, but the host does not enumerate the device. As it stands the code path for the tegra-udc driver is broken in OTG mode. Without proper extcon support we can't support dynamic switching correctly anyways. My hack around method of retaining the phy in peripheral mode and switching drivers to change modes only works because both code paths are incomplete as well, and should not be relied upon. I think for the time being, the tegra-udc driver should check for host, peripheral, or otg mode. If it detects the device is set to otg mode, it should print an error message describing the current situation and fail out. If I had a device to test against with an extcon capable port, I'd try some more experimenting with the chipidea drivers to see if I can get it to work. What do you think? Dmitry, Do you have any devices to experiment with this? Thank you for your time, Peter On Sat, Sep 28, 2019 at 11:36 PM Peter Chen <peter.chen@xxxxxxx> wrote: > > > > > > I've encountered an odd situation where the CI Dual Role driver hard locks the > > kernel on the Ouya (Tegra 3). > > I was attempting to set up manual mode switching in the kernel, as the Ouya lacks > > hardware support for the ID pin and no voltage output on that port. > > I found that the kernel was hard locking whenever I had the dr_mode = "otg" set in > > the devicetree. > > It seems Tegra doesn't support host mode using chipidea driver. The ci_hdrc_tegra.c > only supports device mode. Thierry, could you confirm that? > > Peter > > > No further output was seen on the console, and sysreq does not respond. > > It occurs both in module and builtin mode. > > > > I have however found a workaround. > > By setting the dual role usb device to: > > compatible = "nvidia,tegra30-ehci", "nvidia,tegra30-udc"; and setting the assigned > > phy to: > > dr_mode = "peripheral"; > > I can achieve rudimentary live switching of roles. > > The device defaults to host mode, as the ehci driver enumerates first. > > By unbinding the tegra-ehci driver and binding the tegra-udc driver, I can switch to > > gadget mode. > > The reverse also works. > > The PHY driver does not appear to care if it is always in peripheral mode. > > > > Thank you for your time, > > Peter Geis