On Thu, 15 Jan 2009, Oliver Neukum wrote: > Am Thursday 15 January 2009 20:55:51 schrieb Alan Stern: > > > > > > There is also the potential for the ochi-hcd driver to call usb_hcd_giveback_urb > > > directly if the host controller is no longer running. > > > > > > Is it considered acceptable to call usb_hcd_giveback_urb directly from the > > > urb_dequeue routine or do these drivers need to be updated? > > > > It is indeed acceptable. In fact, it's even acceptable to call > > usb_hcd_giveback_urb directly from the urb_enqueue routine, although I > > don't think any HCDs do this (some peripheral drivers in the gadget > > directory do the analogous thing). > > Is this really wise? Completion handlers will have to lock data structures > also needed by submitting methods. Then the submitting method must release its lock before doing the submission. It has never been specified in the USB kernel documentation that callbacks will occur in a different context from submissions or unlinks. But it does seem unlikely that any HCD will ever complete an URB during the submission, because of the bus transmission time if nothing else. 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