Skip to content

URB disconnect bug fixes

Martin Kelly linux-can 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4can: ems_usb: cancel urb on -EPIPE and -EPROTOdrivers/net/can/usb/ems_usb.c+2 -00 replies
2/4can: esd_usb2: cancel urb on -EPIPE and -EPROTOdrivers/net/can/usb/esd_usb2.c+2 -00 replies
3/4can: kvaser_usb: cancel urb on -EPIPE and -EPROTOdrivers/net/can/usb/kvaser_usb.c+2 -00 replies
4/4can: usb_8dev: cancel urb on -EPIPE and -EPROTOdrivers/net/can/usb/usb_8dev.c+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] URB disconnect bug fixes

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