On Mon, 4 Jun 2012, Felipe Balbi wrote: > On Mon, Jun 04, 2012 at 11:19:06AM -0400, Alan Stern wrote: > > On Mon, 4 Jun 2012, Felipe Balbi wrote: > > > > > This patch introduces support for test modes as > > > defined by the USB OTG & Embedded host Specification. > > > > > > Note that we _must_ be able to suspend & resume ports > > > as we wish, so this driver depends on USB_SUSPEND and > > > makes use (well, somewhat abuses) usb autopm features > > > to achieve what we want. > > > > Have you tested the autopm stuff? I don't think it will work the way > > you've got it. > > well, since I don't have the device myself, someone from a testing lab > has tested this driver. Any ideas how to implement that part with Linux? > That's a hard-requirement for USB OTG Certification, btw. Yes; it needs to be addressed. I believe it will be best to bypass the runtime PM framework. Either send the necessary requests directly to the parent hub, or let's add a test-mode API to the hub driver to do the same thing. In some ways this is simpler than an ordinary device suspend. For example, you're not concerned about remote wakeup, right? > > > +static void otg_eh_disconnect(struct usb_interface *intf) > > > +{ > > > + struct usb_device *udev; > > > + > > > + udev = interface_to_usbdev(intf); > > > + > > > + usb_lock_device_for_reset(udev, intf); > > > > You don't need the locking around usb_reset_device(). Disconnect > > methods are called with the device lock already held. > > Will remove, but it's not what the comment on that function states. Or > at least it was a little dubious. The comment just above the function's kerneldoc has a slightly clearer explanation. Alan Stern -- 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