On Tue, 22 Jul 2003, Johannes Erdfelt wrote: > On Tue, Jul 22, 2003, Alan Stern <[EMAIL PROTECTED]> wrote: > > > It sets the SPD flag for all queued IN packets that don't also > > have IOC set. We need to know as soon as possible if a non-iso. > > transfer gets a short read. > > I don't remember discussing this and I don't think it's a good idea. > > What problem are you trying to fix here? > > Why should we set SPD when the caller specifically tells us not to?
We did talk about this previously, but only very briefly and it was about a month ago. There are several items this change addresses: Somewhat surprisingly, the UHCI Design Guide doesn't say anywhere what the controller will do when it encounters a short IN packet, at least not in the general case. All it does say is in section 3.2.2, under the entry for bit 29 (Short Packet Detect). There it specifies what will happen when the SPD bit is set and a short packet arrives -- but it says nothing about what will happen if SPD _isn't_ set. Rather than rely on manufacturers to Do The Right Thing, it seems safer simply to set the bit. The Guide also mentions that the behavior is _undefined_ when SPD is set for OUT packets. The current code will do that if the user passes in the wrong flag setting. The specified behavior when SPD is set is exactly what we want to happen: the TD is marked inactive, the QH is not updated, and the interrupt pending bit gets set. Maybe if SPD isn't set the first two would still occur; almost certainly there wouldn't be an interrupt request. But we _want_ that interrupt, because a short read terminates a transfer and we have to give back the URB. The setting of SPD is not directly related to the URB_SHORT_NOT_OK flag. All that flag means is that a short read transfer should return with status -EREMOTEIO rather than status 0. This is already tested for and handled properly in uhci_result_control() and uhci_result_common(). The flag doesn't mean that SPD should or should not be set. Taken together, these arguments show that SPD should always be set for every queued (i.e., not isochronous) input TD that's not the last one in its URB. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel