mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-25 23:16:23 -04:00
Merge tag 'linux-can-fixes-for-4.15-20171208' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2017-12-08 this is a pull request of 6 patches for net/master. Martin Kelly provides 5 patches for various USB based CAN drivers, that properly cancel the URBs on adapter unplug, so that the driver doesn't end up in an endless loop. Stephane Grosjean provides a patch to restart the tx queue if zero length packages are transmitted. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -258,21 +258,18 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv,
|
||||
/* if this frame is an echo, */
|
||||
if ((rx_msg_flags & PUCAN_MSG_LOOPED_BACK) &&
|
||||
!(rx_msg_flags & PUCAN_MSG_SELF_RECEIVE)) {
|
||||
int n;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&priv->echo_lock, flags);
|
||||
n = can_get_echo_skb(priv->ndev, msg->client);
|
||||
can_get_echo_skb(priv->ndev, msg->client);
|
||||
spin_unlock_irqrestore(&priv->echo_lock, flags);
|
||||
|
||||
/* count bytes of the echo instead of skb */
|
||||
stats->tx_bytes += cf_len;
|
||||
stats->tx_packets++;
|
||||
|
||||
if (n) {
|
||||
/* restart tx queue only if a slot is free */
|
||||
netif_wake_queue(priv->ndev);
|
||||
}
|
||||
/* restart tx queue (a slot is free) */
|
||||
netif_wake_queue(priv->ndev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -288,6 +288,8 @@ static void ems_usb_read_interrupt_callback(struct urb *urb)
|
||||
|
||||
case -ECONNRESET: /* unlink */
|
||||
case -ENOENT:
|
||||
case -EPIPE:
|
||||
case -EPROTO:
|
||||
case -ESHUTDOWN:
|
||||
return;
|
||||
|
||||
|
||||
@@ -393,6 +393,8 @@ static void esd_usb2_read_bulk_callback(struct urb *urb)
|
||||
break;
|
||||
|
||||
case -ENOENT:
|
||||
case -EPIPE:
|
||||
case -EPROTO:
|
||||
case -ESHUTDOWN:
|
||||
return;
|
||||
|
||||
|
||||
@@ -1326,6 +1326,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
|
||||
case 0:
|
||||
break;
|
||||
case -ENOENT:
|
||||
case -EPIPE:
|
||||
case -EPROTO:
|
||||
case -ESHUTDOWN:
|
||||
return;
|
||||
default:
|
||||
|
||||
@@ -593,6 +593,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
|
||||
|
||||
case -ENOENT:
|
||||
case -EPIPE:
|
||||
case -EPROTO:
|
||||
case -ESHUTDOWN:
|
||||
return;
|
||||
|
||||
|
||||
@@ -524,6 +524,8 @@ static void usb_8dev_read_bulk_callback(struct urb *urb)
|
||||
break;
|
||||
|
||||
case -ENOENT:
|
||||
case -EPIPE:
|
||||
case -EPROTO:
|
||||
case -ESHUTDOWN:
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user