On Wed, 29 Aug 2012, Sebastian Andrzej Siewior wrote:

> > > The BULK URBs usually don't make a scene. They re-submit the complete
> > > queue length in BH so we have a little time in between. The INTR URB is
> > > more evil because usbnet's intr_complete() causes to re-submitt it
> > > immediately. That means we hardly do any progress and end up in a
> > > busy loop.
> > 
> > This sounds like a possible bug in usbnet.  If usbnet encounters
> > repeated failures while trying to communicate with a USB device, it
> > shouldn't continue to retry indefinitely.  It should eventually give
> > up, and maybe do a device reset.
> 
> So to interrupt the intr packets we need atleast
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 8531c1c..8dc3705 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -194,6 +194,7 @@ static void intr_complete (struct urb *urb)
>       /* software-driven interface shutdown */
>       case -ENOENT:           /* urb killed */
>       case -ESHUTDOWN:        /* hardware gone */
> +     case -EPIPE:
>               netif_dbg(dev, ifdown, dev->net,
>                         "intr shutdown, code %d\n", status);
>               return;

No, that's not right.  For one thing, the error is -EPROTO, not -EPIPE.  
But aside from that, usbnet has a comment a little farther down:

        /* NOTE:  not throttling like RX/TX, since this endpoint
         * already polls infrequently
         */

Corresponding to this, there's a comment in dummy-hcd:

                case PIPE_INTERRUPT:
                        /* FIXME is it urb->interval since the last xfer?
                         * this almost certainly polls too fast.
                         */

So the problem appears to be that dummy-hcd doesn't implement the right
interval for periodic transfers.  I'd accept a patch to fix that.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to