Commit fd29117a authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.15-20171208' of...

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 03afb6e4 91785de6
...@@ -258,21 +258,18 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv, ...@@ -258,21 +258,18 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv,
/* if this frame is an echo, */ /* if this frame is an echo, */
if ((rx_msg_flags & PUCAN_MSG_LOOPED_BACK) && if ((rx_msg_flags & PUCAN_MSG_LOOPED_BACK) &&
!(rx_msg_flags & PUCAN_MSG_SELF_RECEIVE)) { !(rx_msg_flags & PUCAN_MSG_SELF_RECEIVE)) {
int n;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&priv->echo_lock, 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); spin_unlock_irqrestore(&priv->echo_lock, flags);
/* count bytes of the echo instead of skb */ /* count bytes of the echo instead of skb */
stats->tx_bytes += cf_len; stats->tx_bytes += cf_len;
stats->tx_packets++; stats->tx_packets++;
if (n) { /* restart tx queue (a slot is free) */
/* restart tx queue only if a slot is free */ netif_wake_queue(priv->ndev);
netif_wake_queue(priv->ndev);
}
return 0; return 0;
} }
......
...@@ -288,6 +288,8 @@ static void ems_usb_read_interrupt_callback(struct urb *urb) ...@@ -288,6 +288,8 @@ static void ems_usb_read_interrupt_callback(struct urb *urb)
case -ECONNRESET: /* unlink */ case -ECONNRESET: /* unlink */
case -ENOENT: case -ENOENT:
case -EPIPE:
case -EPROTO:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
......
...@@ -393,6 +393,8 @@ static void esd_usb2_read_bulk_callback(struct urb *urb) ...@@ -393,6 +393,8 @@ static void esd_usb2_read_bulk_callback(struct urb *urb)
break; break;
case -ENOENT: case -ENOENT:
case -EPIPE:
case -EPROTO:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
......
...@@ -1326,6 +1326,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb) ...@@ -1326,6 +1326,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
case 0: case 0:
break; break;
case -ENOENT: case -ENOENT:
case -EPIPE:
case -EPROTO:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
default: default:
......
...@@ -593,6 +593,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb) ...@@ -593,6 +593,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
case -EPIPE: case -EPIPE:
case -EPROTO:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
......
...@@ -524,6 +524,8 @@ static void usb_8dev_read_bulk_callback(struct urb *urb) ...@@ -524,6 +524,8 @@ static void usb_8dev_read_bulk_callback(struct urb *urb)
break; break;
case -ENOENT: case -ENOENT:
case -EPIPE:
case -EPROTO:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment