On Wed, 10 Jun 2009, Pete Zaitcev wrote: > On Wed, 10 Jun 2009 12:23:52 -0700, Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> wrote: > > > The problem with a callback is I'm not sure if drivers would be happy > > with a callback that runs in interrupt context. [] > > Of course they would. > > You're way overthinking it. For drivers that clear halts in process > context, you add a new function > usb_reset_endpoint_sync > Which works just like usb_control_msg: calls the new function > usb_reset_endpoint_submit // name does not matter > then waits. Use a little caller-allocated struct "ep_reset" with > callback pointer, ep pointer, callback argument. What can be simpler? > > Fix the usb-storage to use the sync version so you know it works. > I'll fix ub for you, so you don't need to learn its state machine. > > Once all users flip over to the new functions above, just delete > the one that exists now. The gcc tells you if anything was forgotten. Another possibility, perhaps simpler, is this: Make the HCD's endpoint_reset method always runnable in interrupt context, and have it mark the endpoint (or QH or whatever) to indicate that it is being reset. New URB submissions will be accepted but delayed until the reset finishes. When the reset is over, if there are URBs on the endpoint's queue, start them going. 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