From: Felipe Balbi Date: Tue, 4 Oct 2016 12:14:43 +0000 (+0300) Subject: usb: gadget: function: u_ether: don't starve tx request queue X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aabb786654ec7940361841825dc3f5993cb85095;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git usb: gadget: function: u_ether: don't starve tx request queue commit 6c83f77278f17a7679001027e9231291c20f0d8a upstream. If we don't guarantee that we will always get an interrupt at least when we're queueing our very last request, we could fall into situation where we queue every request with 'no_interrupt' set. This will cause the link to get stuck. The behavior above has been triggered with g_ether and dwc3. Reported-by: Ville Syrjälä Signed-off-by: Felipe Balbi Signed-off-by: Willy Tarreau --- diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 80294f320e1..c93e6a1bbc4 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -958,9 +958,11 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb, req->length = length; - /* throttle highspeed IRQ rate back slightly */ + /* throttle high/super speed IRQ rate back slightly */ if (gadget_is_dualspeed(dev->gadget) && - (dev->gadget->speed == USB_SPEED_HIGH)) { + (dev->gadget->speed == USB_SPEED_HIGH || + dev->gadget->speed == USB_SPEED_SUPER) && + !list_empty(&dev->tx_reqs)) { dev->tx_qlen++; if (dev->tx_qlen == (qmult/2)) { req->no_interrupt = 0;