On Sun, Jul 06, 2014 at 01:31:37PM +0800, Peter Chen wrote: > On Fri, Jul 04, 2014 at 11:54:57AM +0200, Michael Grzeschik wrote: > > On Fri, Jul 04, 2014 at 01:39:08AM +0000, Peter Chen wrote: > > > > > > > > > > > > > > > > > > > Yes, it has already implemented at ci_usc_vbus_session. > > > > > > > > > > > I see the code path in ci_udc_vbus_session of udc.c to trigger such > > > > > > an event, but unfortunately it was never possible to run into that > > > > code. > > > > > > > > > > > > The function ci_otg_work in otg.c is prepared to do that in case the > > > > > > irq got triggered by OTGSC_BSVIS bit change. > > > > > > > > > > > > This is true for plugging, but never happened to be called on > > > > unplugging. > > > > > > Is there anything missing to get this working? Or is this completely > > > > > > impossible by the core? I was already fiddling around with the other > > > > > > irq cases OTGSC_*IE, but never got anything useful. > > > > > > > > > > Once the vbus lower than B_SESSION_VALID, it will trigger (set > > > > > OTGSC_BSVIS too) BSV interrupt. > > > > > > > > By theory! ;) > > > > > > > > > Check your vbus after unplugging please. > > > > > > > > Today I measured the voltage level on vbus and it still had ~2.6V while > > > > being not connected to anything. > > > > > > > > > > I am working on the imx25 otg capable SoC. > > > > > > > > I validated this with two different imx25 boards and realized, that we > > > > have this external vbus divider errata for that SoC. > > > > > > > > Errata: ENGcm09152 > > > > > > > > Its likely that the issue is related to this problem as the vbus was not > > > > connected to anything different, than the SoC in that case. > > > > > > > > > > Check the voltage at both cpu side (otgsc get value from it) and connector. > > > check if you have a big cap at vbus. > > > > > check if set otgsc.vd makes things different > > > > This bit changes a lot! :) With that bit set, it works as > > expected. The odd thing is that, without having an gadget > > loaded (not having RUN/STOP bit set in USBCMD) it was working > > already as expected. After starting the controller with setting > > RUN/STOP bit in USBCMD no plug/unplug irqs occurred anymore. > > > > It is not reasonable dp pullup will affect vbus, check if the board > design causes it or the SoC (or its setting) causes it, I add Fabio > in cc list, if possible, we can check if Freescale evk has this problem > or not. I have tested this here with to independent board designs. Both act the same way as described above. Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html