mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
usb: gadget: function: u_ether: don't starve tx request queue
commit 6c83f77278 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ä <ville.syrjala@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c051038301
commit
660c04e8f1
@@ -596,8 +596,9 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
|
||||
|
||||
/* throttle high/super speed IRQ rate back slightly */
|
||||
if (gadget_is_dualspeed(dev->gadget))
|
||||
req->no_interrupt = (dev->gadget->speed == USB_SPEED_HIGH ||
|
||||
dev->gadget->speed == USB_SPEED_SUPER)
|
||||
req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH ||
|
||||
dev->gadget->speed == USB_SPEED_SUPER)) &&
|
||||
!list_empty(&dev->tx_reqs))
|
||||
? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0)
|
||||
: 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user