Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH 0/4] URB disconnect bug fixes
@ 2017-12-05 19:15 Martin Kelly
  2017-12-05 19:15 ` [PATCH 1/4] can: ems_usb: cancel urb on -EPIPE and -EPROTO Martin Kelly
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Martin Kelly @ 2017-12-05 19:15 UTC (permalink / raw)
  To: linux-can
  Cc: Marc Kleine-Budde, Wolfgang Grandegger, Stefan Mätje,
	Jimmy Assarsson, Martin Kelly

This patch series is to fix a common bug I found in mcba_usb that appears to
also exist in these drivers. Because I don't own the hardware, I cannot test the
changes, but I wanted to send the change so that others could do so.

The bug is that, when you disconnect the device, you get -EPIPE and -EPROTO
error codes (exactly which depends on the timing and the system) in the URB read
callback. The driver then resubmits the URB, which immediately fails because the
device is unplugged. On a slower system like a Raspberry Pi, this can cause a
kernel stall, while on a desktop, the disconnect code runs fast enough to
prevent a stall and it's easy not to notice the issue.

Fix this by not resubmitting an URB that receives an -EPIPE/-EPROTO code.

Martin Kelly (4):
  can: ems_usb: cancel urb on -EPIPE and -EPROTO
  can: esd_usb2: cancel urb on -EPIPE and -EPROTO
  can: kvaser_usb: cancel urb on -EPIPE and -EPROTO
  can: usb_8dev: cancel urb on -EPIPE and -EPROTO

 drivers/net/can/usb/ems_usb.c    | 2 ++
 drivers/net/can/usb/esd_usb2.c   | 2 ++
 drivers/net/can/usb/kvaser_usb.c | 2 ++
 drivers/net/can/usb/usb_8dev.c   | 2 ++
 4 files changed, 8 insertions(+)

--
2.11.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-06  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 4/4] can: usb_8dev: " Martin Kelly
2017-12-06  9:20 ` [PATCH 0/4] URB disconnect bug fixes Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox