On Friday 24 January 2003 21:20, David Brownell wrote:
> Duncan Sands wrote:
> >        I don't know what
> > failure code I'm worried about, that's kind of the point.  I see that
> > there can be failures, and that I'd need to go code trawling to find out
> > all the possibilities.  Drivers need to be able to deal with failures of
> > all kinds.
>
> If you haven't seen such errors, then the best strategy is likely
> to handle the obvious ones (EINVAL/ENODEV --> your bug, EBUSY --> it's
> already completing, EAGAIN --> retry) and log diagnostics for other
> cases.  Pretty much the same as with any other exotic fault mode
> you're not certain about.

Hi Dave, I'm confused: is this really a good strategy?  (In what follows I talk
only of synchroneous unlinking).  Suppose I get an "unknown error".  Then either:
(1) in fact it worked: the urb is going to complete.
(2) it didn't work: the urb is not going to complete, at least not straight away.

Typically you want to free memory and such like after usb_unlink_urb.
So it would be fatal to continue if you are in state (2).  But you don't
know which state you are in.  So you must assume you are in state (2).
Thus all you can do is wait a bit and retry usb_submit_urb.  But then you
have no guarantee that you will not loop forever (similar problem with
-EAGAIN).  So the correct functioning of the driver depends on which
way the wind is blowing that day...  It seems to me that the basic problem
is that the semantics of usb_unlink_urb are not clear (this includes possible
error behaviour).  Am I asking too much?  Maybe I've been doing too much
mathematics lately...

> >>FWIW one of the patches I recently posted gets rid of some such
> >>failure cases in the EHCI code.
> >
> > I couldn't find it.  Pointers?
>
> http://marc.theaimsgroup.com/?l=linux-usb-devel&m=104326655631544&w=2

OK, got it, thanks.

All the best,

Duncan.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to