On 10.10.2013 19:03, Sebastian Andrzej Siewior wrote: > On 10/10/2013 06:37 PM, Daniel Mack wrote: >> Other than that, please make sure not to call that function more than >> once for dual role mode. > > A small hint please. We need it once in the hub code. So the host mode > works if no gadget is loaded. And we need once in musb_gadget_start() so > it executed again after rmmod gadget / modprobe gadget. Hmm, maybe it's even ok to call it more than once. Now that I look at the code again, I actually don't see why we shouldn't. That function is destructive wrt a running session, but a role change will tear down all active communication anyway. > But maybe we should remove musb_stop() from stop_activity() because it > might "pause" the host side if UDC isn't used and we remove the gadget. > > Or do we the simple way and in OTG mode the host only works if a gadget > is loaded (maybe not something one would expect)? I don't know how other controllers do it, but I'd find the latter confusing. If we switch to host mode, we should start the HCD right away. I'd happily test patches on my host-only platform if you send me any :) Daniel -- 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