• Ahmed S. Darwish's avatar
    can: kvaser_usb: Read all messages in a bulk-in URB buffer · 9c8090e1
    Ahmed S. Darwish authored
    [ Upstream commit 2fec5104 ]
    
    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: default avatarAhmed S. Darwish <ahmed.darwish@valeo.com>
    Cc: linux-stable <stable@vger.kernel.org>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
    9c8090e1
kvaser_usb.c 39.3 KB