Linux CAN drivers development
 help / color / mirror / Atom feed
From: Martin Kelly <mkelly@xevo.com>
To: linux-can@vger.kernel.org
Cc: "Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Wolfgang Grandegger" <wg@grandegger.com>,
	"Stefan Mätje" <Stefan.Maetje@esd.eu>,
	"Jimmy Assarsson" <jimmyassarsson@gmail.com>,
	"Martin Kelly" <mkelly@xevo.com>
Subject: [PATCH 4/4] can: usb_8dev: cancel urb on -EPIPE and -EPROTO
Date: Tue,  5 Dec 2017 11:15:50 -0800	[thread overview]
Message-ID: <20171205191550.703-5-mkelly@xevo.com> (raw)
In-Reply-To: <20171205191550.703-1-mkelly@xevo.com>

In mcba_usb, we have observed that when you unplug the device, the driver will
endlessly resubmit failing URBs, which can cause CPU stalls. This issue
is fixed in mcba_usb by catching the codes seen on device disconnect
(-EPIPE and -EPROTO).

This driver also resubmits in the case of -EPIPE and -EPROTO, so fix it
in the same way.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 drivers/net/can/usb/usb_8dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index d000cb62d6ae..27861c417c94 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -524,6 +524,8 @@ static void usb_8dev_read_bulk_callback(struct urb *urb)
 		break;
 
 	case -ENOENT:
+	case -EPIPE:
+	case -EPROTO:
 	case -ESHUTDOWN:
 		return;
 
-- 
2.11.0


  parent reply	other threads:[~2017-12-05 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 19:15 [PATCH 0/4] URB disconnect bug fixes Martin Kelly
2017-12-05 19:15 ` [PATCH 1/4] can: ems_usb: cancel urb on -EPIPE and -EPROTO Martin Kelly
2017-12-05 19:15 ` [PATCH 2/4] can: esd_usb2: " Martin Kelly
2017-12-05 19:15 ` [PATCH 3/4] can: kvaser_usb: " Martin Kelly
2017-12-05 19:15 ` Martin Kelly [this message]
2017-12-06  9:20 ` [PATCH 0/4] URB disconnect bug fixes Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171205191550.703-5-mkelly@xevo.com \
    --to=mkelly@xevo.com \
    --cc=Stefan.Maetje@esd.eu \
    --cc=jimmyassarsson@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox