Alan Stern wrote:

At the risk of sounding like a broken record, device
drivers that don't have synchronization on resubmit
paths are buggy, and they need to add it.


Wouldn't it be nice if the core provided a mechanism (not a policy!) that would make it easy for drivers to synchronize on resubmit paths without having to add a lot of tricky locking code? endpoint_disable() combined with urb_begone() might well be enough.

I like the idea of a "nuke all the urbs!" request. It's easy do; we have endpoint_disable() already. Just:

  - In usb_device, add 32 bits of "is it enabled" flags
  - Make endpoint_disable() and usb_submit_urb() use those flags
  - Export some is_endpoint_enabled() primitive
  - Have usb_endpoint_disable() do the obvious
  - Define usb_endpoint_reenable() likewise
  - ... anything else?  (urb_begone wouldn't be needed!!)

I don't actually recall any case where unlink _one_ of the urbs
on a given endpoint was really the answer ... "all" is generally
the answer.  I can think of several places we could remove code,
given that primitive...

I'd actually call that "tedious" locking, not tricky.   (Some
would say all locks are tricky.  Bah!)  And I think the current
"endpoint disable" semantics aren't quite right there -- it'd
likely be better if it didn't invalidate hardware state, surely
some hardware will complain if we do that needlessly.


Yeah ... maybe we could wrap up this email thread that way. That'd make a lot of us happier!

- 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

Reply via email to