Chen Peter-B29397 <B29397@xxxxxxxxxxxxx> writes: > >> > > hw_write(ci, OP_USBINTR, ~0, >> > > >> USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); >> > > - hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); >> > > } else { >> > > - hw_write(ci, OP_USBCMD, USBCMD_RS, 0); >> > > hw_write(ci, OP_USBINTR, ~0, 0); >> > > } >> > >> > Hi Marc, your above change break the function that load gadget before >> > plug usb cable. >> >> What do you mean with that? When switching into device role, the >> otg can load every gadget-module without having the hardware pluged-in. >> > > Are you sure? In current chipidea otg design, the gadget will be freed > when device->host, but the gadget will not be re-created when host->device. > So, when the device connects to pc again, there will be an null pointer error. > (I use g_serial.ko) Hmm, gadget gets zeroed out on every gadget->whatever switch, but it also gets reinitialized on every whatever->gadget transition. And it really shouldn't cause a null dereference. Are you running getty on g_serial's tty or are you just echo'ing to it? I remember there was a problem with it assuming that there's always both tx and rx. Regards, -- Alex -- 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