On Fri, 24 Feb 2012, Sarah Sharp wrote: > We could use the bandwidth_mutex to do mutual exclusion. And yes, it > might be tricky. I think as long as we narrow the exclusion range to > exactly when we're adding or dropping endpoints, and around the function > that decrements the hub-initiated LPM counter and updates the timers, I > think we should be fine. And around the function that increments the counter and disables the timers. > Then usb_set_interface would block on the mutex if the driver that's > being bound needs to disable the hub-initiated timeouts. If the set > interface grabbed the mutex first, and enabled the timeouts, that's > fine, because the bind will grab the mutex, disable the timeouts, and > drop the mutex before the driver probe function gets called. > > As long as the timeouts are disabled before the requesting driver can > use the new interface or configuration, it doesn't matter if they > flip-flop between enabled and disabled in that intermediate period. It > will cause the xHCI driver to execute some extra commands, but drivers > don't change interfaces or bind/unbind very often, so I don't think > there's a performance issue there. Okay, that sounds like a reasonable plan. 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