Pete: Any more thoughts about this?
On Wed, 12 Jan 2005, Alan Stern wrote: > On Tue, 11 Jan 2005, Pete Zaitcev wrote: > > > As I mentioned previously, I have investigated this behaviour while working > > with ub. You can wait until you blue in the face, the device simply won't > > respond until pipes are cleared and TOGGLES ARE RESET. > > I could more easily believe this is a problem with the toggles than with > the pipes. If the pipe was halted you should have gotten a STALL error, > not a timeout. But if the toggle was wrong it could easily result in a > timeout. > > Also, it's quite possible that a device might fail to interpret the > SET_INTERFACE command sent by usbcore (when a driver is unbound) as a > command to reset the toggles of the endpoints belonging to the interface. > According to section 9.1.1.5 of the USB 2.0 spec: > > Configuring a device or changing an alternate setting causes > all of the status and configuration values associated with > endpoints in the affected interfaces to be set to their default > values. This includes setting the data toggle of any endpoint > using data toggles to the value DATA0. > > I suppose it's possible that the drive doesn't do this because the > alternate setting isn't _changed_, it's just reset to the same value it > had previously. This would be perverse, but it's not impossible. (Or > maybe the device is simply buggy.) > > You could confirm this theory by adding a line to the dissociate_dev() > routine in drivers/usb/storage/usb.c. Print out the values of > > usb_gettoggle(us->pusb_dev, usb_pipeendpoint(us->recv_bulk_pipe), 0) > > and > > usb_gettoggle(us->pusb_dev, usb_pipeendpoint(us->send_bulk_pipe), 1) > > The theory says that whenever either of these is nonzero (or maybe > whenever the first is nonzero, or whenever the second is nonzero) you will > see your problem the next time usb-storage is loaded. If both are zero > then the next load will work okay. > > Assuming the theory turns out to be true, it indicates a problem not in > usb-storage but in usbcore. We might need to reset all bulk and interrupt > pipes in an interface whenever a SET_INTERFACE is issued. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
