On Thu, 14 Jul 2005, Pete Zaitcev wrote:

> On Thu, 14 Jul 2005 10:22:59 -0400 (EDT), Alan Stern <[EMAIL PROTECTED]> 
> wrote:
> 
> > However this ignores the matter of retrying submissions that fail with 
> > -ENXIO, -EAGAIN, or -ENOMEM.  Maybe you could add an additional argument 
> > to usb_sg_submit to specify whether such failures should be retried.
> 
> I don't like such functions with variable behaviour and the duplication
> is not big enough here.

Okay.

> As for usb_sg_cancel in case of an error, the logic was that it makes
> no difference, so why do it?

It makes no difference in terms of the values you return to the caller, 
but it does make a difference in terms of performance.  It's better to 
fail-fast than to fail-slow.  On the other hand, it's true that this is a 
low-probability failure mode and hence the performance isn't very 
important.

>  Even if I call it, I cannot return with
> anything but zero error code (unless the very first submit fails).

That's right.

> But calling this cancel adds an opportunity for racing somewhere.

No it doesn't.  The opportunity was there all along.  Remember, the caller 
could call usb_sg_cancel from another thread at precisely this time.

> I do not trust our code in this area. Remember, ub must not crash.
> Unlinking is the crashiest thing in the whole stack, so heck no.

I can understand that at the moment you don't trust the new usb_sg code.  
Without a lot of checking and testing, you shouldn't.  However it's not 
_impossibly_ difficult, and with some work you ought to be able to resolve 
all the possible races.  (With the changes I suggested it should be pretty 
close already.)

Trusting unlinks is a separate matter.  However I think they are pretty 
well under control now.  I can't recall hearing of any problems in the HCD 
code relating to buggy unlinks for quite some time.

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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

Reply via email to