updated patch with throttling

Roman Kagan rkagan at mail.ru
Fri Mar 25 06:50:08 EST 2005


On Fri, Mar 25, 2005 at 12:35:16PM +0100, Duncan Sands wrote:
> > Below is the updated patch which avoids both deadlock and livelock in
> > case of repetitive urb submission failures.  It does that by adding two
> > timers (for either direction) to make sure the processing is restarted
> > after the submission error but with a delay of THROTTLE_MSECS which I
> > arbitrarily set to 5.
> 
> does this handle stalls?

That's done exactly to handle stalls.  If the process stalls, after
THROTTLE_MSECS it'll be forced to start over.  I tend to think it's
better then both starting over immediately and stopping forever.

> By the way, IIRC, the previous code was
> supposed to work like this: if you had N urbs, and N successive
> urb submissions failed, then it was no longer possible to send
> packets

I thought so too, but upon closer inspection I realized that a failed
urb submission didn't cause a break from the main loop in
usbatm_process_{receive,send}, so it went over and over => livelock if
the submission error was permanent.

(The main loop in these functions was delimited by

made_progress:
  ...
  goto made_progress;

which confused me at first.)

Cheers,
  Roman.



More information about the Usbatm mailing list