From: Martin Kelly <mkelly@xevo.com>
To: linux-can@vger.kernel.org
Cc: "Remigiusz Kołłątaj" <remigiusz.kollataj@mobica.com>,
"Marc Kleine-Budde" <mkl@pengutronix.de>,
"Wolfgang Grandegger" <wg@grandegger.com>,
"Martin Kelly" <mkelly@xevo.com>
Subject: [PATCH v2 2/2] can: mcba_usb: fix device disconnect bug
Date: Mon, 27 Nov 2017 15:49:16 -0800 [thread overview]
Message-ID: <20171127234916.25865-2-mkelly@xevo.com> (raw)
In-Reply-To: <20171127234916.25865-1-mkelly@xevo.com>
Currently, when you disconnect the device, the driver infinitely
resubmits all URBs, so you see:
Rx URB aborted (-32)
in an infinite loop.
Fix this by catching -EPIPE (what we get in urb->status when the device
disconnects) and not resubmitting.
With this patch, I can plug and unplug many times and the driver
recovers correctly.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
drivers/net/can/usb/mcba_usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
index c4355f0a20d5..ef417dcddbf7 100644
--- a/drivers/net/can/usb/mcba_usb.c
+++ b/drivers/net/can/usb/mcba_usb.c
@@ -592,6 +592,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
break;
case -ENOENT:
+ case -EPIPE:
case -ESHUTDOWN:
return;
--
2.11.0
next prev parent reply other threads:[~2017-11-27 23:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 23:49 [PATCH v2 1/2] can: mcba_usb: fix typo Martin Kelly
2017-11-27 23:49 ` Martin Kelly [this message]
2017-11-28 8:46 ` Marc Kleine-Budde
2017-11-28 21:09 ` Martin Kelly
2017-11-29 12:20 ` CAN-USB adapter unplug (was: Re: [PATCH v2 1/2] can: mcba_usb: fix typo) Marc Kleine-Budde
2017-11-29 15:21 ` CAN-USB adapter unplug Stefan Mätje
2017-11-29 17:07 ` Martin Kelly
2017-11-30 10:18 ` Jimmy Assarsson
2017-11-30 18:19 ` Martin Kelly
2017-12-04 8:39 ` Jimmy Assarsson
2017-12-05 23:42 ` Martin Kelly
2017-12-06 9:30 ` Jimmy Assarsson
2017-12-01 2:06 ` Martin Kelly
2017-11-29 17:04 ` Martin Kelly
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=20171127234916.25865-2-mkelly@xevo.com \
--to=mkelly@xevo.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=remigiusz.kollataj@mobica.com \
--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