On Tue, 29 Jun 2004, Oliver Neukum wrote: > Am Montag, 28. Juni 2004 17:33 schrieb Alan Stern: > > > Hmm, I see. Tradeoff time. I'd say take whichever causes > > > least impact to device drivers ... didn't you originally > > > suggest taking the device out of suspend before unbind? :) > > > > I don't remember suggesting that. It isn't practical if there are any > > suspended hubs between the root and the device. My preference goes to > > installing altsetting 0 as soon as possible, which means when the device > > resumes. There could just be a little loop in one of the resume() > > routines that looks for unbound interfaces not in altsetting 0. > > As soon as possible would be right after the suspend() callback. > If you are switching to that then nothing is needed in case of soft > disconnect. > You should really preserve the sense of disconnect() as a pure > binding change if possible at all.
I think the conversation has gotten confused by lack of context; your comment doesn't make sense for what I was talking about. To reprise: Suppose that while a device is suspended its driver is rmmod'ed. Usbcore always tries to put an interface back in altsetting 0 when it is unbound from a driver, but in this case it can't because the device is asleep. It's not possible to communicate with the device at all until it resumes; at that time is the soonest opportunity for selecting altsetting 0. This has nothing to do with considering disconnect() as anything other than a binding change. And you certainly don't want to switch to altsetting 0 immediately after the suspend() callback returns, because that will confuse the driver in the common case where it remains bound to the device. Alan Stern ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel