Skip to content

Commit fd29117

Browse files
committed
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>
2 parents 03afb6e + 91785de commit fd29117

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

drivers/net/can/peak_canfd/peak_canfd.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,21 +258,18 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv,
258258
/* if this frame is an echo, */
259259
if ((rx_msg_flags & PUCAN_MSG_LOOPED_BACK) &&
260260
!(rx_msg_flags & PUCAN_MSG_SELF_RECEIVE)) {
261-
int n;
262261
unsigned long flags;
263262

264263
spin_lock_irqsave(&priv->echo_lock, flags);
265-
n = can_get_echo_skb(priv->ndev, msg->client);
264+
can_get_echo_skb(priv->ndev, msg->client);
266265
spin_unlock_irqrestore(&priv->echo_lock, flags);
267266

268267
/* count bytes of the echo instead of skb */
269268
stats->tx_bytes += cf_len;
270269
stats->tx_packets++;
271270

272-
if (n) {
273-
/* restart tx queue only if a slot is free */
274-
netif_wake_queue(priv->ndev);
275-
}
271+
/* restart tx queue (a slot is free) */
272+
netif_wake_queue(priv->ndev);
276273

277274
return 0;
278275
}

drivers/net/can/usb/ems_usb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ static void ems_usb_read_interrupt_callback(struct urb *urb)
288288

289289
case -ECONNRESET: /* unlink */
290290
case -ENOENT:
291+
case -EPIPE:
292+
case -EPROTO:
291293
case -ESHUTDOWN:
292294
return;
293295

drivers/net/can/usb/esd_usb2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ static void esd_usb2_read_bulk_callback(struct urb *urb)
393393
break;
394394

395395
case -ENOENT:
396+
case -EPIPE:
397+
case -EPROTO:
396398
case -ESHUTDOWN:
397399
return;
398400

drivers/net/can/usb/kvaser_usb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
13261326
case 0:
13271327
break;
13281328
case -ENOENT:
1329+
case -EPIPE:
1330+
case -EPROTO:
13291331
case -ESHUTDOWN:
13301332
return;
13311333
default:

drivers/net/can/usb/mcba_usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
593593

594594
case -ENOENT:
595595
case -EPIPE:
596+
case -EPROTO:
596597
case -ESHUTDOWN:
597598
return;
598599

drivers/net/can/usb/usb_8dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ static void usb_8dev_read_bulk_callback(struct urb *urb)
524524
break;
525525

526526
case -ENOENT:
527+
case -EPIPE:
528+
case -EPROTO:
527529
case -ESHUTDOWN:
528530
return;
529531

0 commit comments

Comments
 (0)