]> git.baikalelectronics.ru Git - kernel.git/commit
can: kvaser_usb: Read all messages in a bulk-in URB buffer
authorAhmed S. Darwish <ahmed.darwish@valeo.com>
Thu, 26 Feb 2015 15:22:02 +0000 (10:22 -0500)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 9 Mar 2015 09:22:24 +0000 (10:22 +0100)
commitb73df35df1025253d0a036c1d9bebbd820cb2416
tree7c3fa357f160f9bf6dc44d6d4a87bc73ac4117a5
parente0de562292f850d8e45d038b6649ce7c21be3f67
can: kvaser_usb: Read all messages in a bulk-in URB buffer

The Kvaser firmware can only read and write messages that are
not crossing the USB endpoint's wMaxPacketSize boundary. While
receiving commands from the CAN device, if the next command in
the same URB buffer crossed that max packet size boundary, the
firmware puts a zero-length placeholder command in its place
then moves the real command to the next boundary mark.

The driver did not recognize such behavior, leading to missing
a good number of rx events during a heavy rx load session.

Moreover, a tx URB context only gets freed upon receiving its
respective tx ACK event. Over time, the free tx URB contexts
pool gets depleted due to the missing ACK events. Consequently,
the netif transmission queue gets __permanently__ stopped; no
frames could be sent again except after restarting the CAN
newtwork interface.

Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb.c