On Wed, 10 Dec 2003, David Brownell wrote:
... usb_sg_wait().... It resembles usb_bulk_msg() except that there's actually a way to cancel the request: an async unlink.
Usbcore can't add an exactly corresponding usb_urb_wait() since it doesn't have a way to cancel urbs before they're submitted (to prevent submit from succeeding in some exotic races).
Just that sort of mechanism was one of the things I am proposing -- and below you propose something like it too!
Actually I didn't "propose" it. Such a mechanism would necessarily be API-incompatible, for one thing ... all drivers that resubmit would need to change.
I don't know about OHCI and EHCI, but the UHCI driver does ignore kicks given before requests are queued to the hardware.
Those mis-handle that case too. Yep, "should be fixed" -- easy to do, just check urb->status and giveback() -- but low priority.
I like the idea of a "nuke all the urbs!" request. It's easy do; we have endpoint_disable() already. Just: ...
It sounds good. I would change it somewhat so that the new disable mechanism wouldn't affect the hardware state at all; it would simply prevent the future submission of URBs for that endpoint while leaving ones that are already linked alone. There remains the problem that you would never want to disable ep0 like this, but device drivers should never resubmit URBs to ep0 anyway.
Device drivers do need to talk to ep0 asynchronously, they can't always use usb_control_msg() and friends. I'd just make that driver-visible "abort pipe" request fail on ep0, since all the config's drivers need to share it.
What I found rather amusing was that well-timed query about the MS-Windows URB_FUNCTION_ABORT_PIPE request ... it's more or less that "nuke all the URBs!" primitive, though it leaves the "pipe" enabled. (Which means it doesn't address those resubmit synch issues you're concerned with...) And my very quick google on the topic didn't turn up an "unlink one URB" primitive in that MSFT API, FWIW ... ;)
- Dave
------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
