updated patch with throttling

Roman Kagan rkagan at mail.ru
Fri Mar 25 07:29:08 EST 2005

On Fri, Mar 25, 2005 at 01:00:03PM +0100, Duncan Sands wrote:
> > 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.
> that doesn't seem right.  For example, in usbatm_process_send there is:
>                 if ((err = usb_submit_urb(snd->urb, GFP_ATOMIC)) < 0) {
>                         dbg("usbatm_process_send: urb submission failed (%d)!", err);
>                         spin_lock_irq(&instance->send_lock);
>                         list_add(&snd->list, &instance->spare_senders);
>                         spin_unlock_irq(&instance->send_lock);
>                         list_add(&buf->list, &instance->filled_send_buffers);
>                         return; /* bail out */
>                 }

Indeed, sorry for confusion.  I was looking at usbatm_process_receive
which only breaks from the inner loop in case of submission error.  And
it looks like the outer loop won't go indefinitely too: it'll break out
once all filled_buffers are emptied.

But then it makes for stalls (which I called deadlocks, but they may not
actually be so "dead", as you can reload the driver or reconnect the
modem and clean it up).


More information about the Usbatm mailing list