On Wed, 30 Nov 2005, ambat sasi nair wrote: > Hi, > > Current in finish_reply(), case DATA_DIR_TO_HOST for the bulk-only > portion, the ep is halted after the data transfer is started when Hi>Di > (refered to in the USB Mass Storage Bulk-only spec). However, the data > transfer may not have finished before stall signalling starts. Also on > clearing the stall, the host expects to read the CSW and not the data. > So I suggest the halting of the ep should be done in bulk_in_complete > when the data transfer has actually completed. Any comments?
This is a tricky subject. Lots of device controllers have problems halting a bulk-in endpoint that has data queued in its fifo. There's no guarantee when bulk_in_complete is called that the data has actually been transmitted. All you know is that the controller driver has accepted the data. So while it wouldn't hurt to wait for the completion, it probably wouldn't help much either. Note this comment from include/linux/usb_gagdget.h:usb_ep_set_halt: * Returns zero, or a negative error code. On success, this call sets * underlying hardware state that blocks data transfers. * Attempts to halt IN endpoints will fail (returning -EAGAIN) if any * transfer requests are still queued, or if the controller hardware * (usually a FIFO) still holds bytes that the host hasn't collected. So if the controller driver is written correctly, trying to halt the bulk-in endpoint will fail if all the queued data has not yet been sent. When this happens, file_storage sleeps for a while and then retries the halt. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel