]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: can: j1939: recover socket queue on CAN bus error during BAM transmission
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 28 May 2024 07:06:48 +0000 (09:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:08:30 +0000 (09:08 +0200)
commit 9ad1da14ab3bf23087ae45fe399d84a109ddb81a upstream.

Addresses an issue where a CAN bus error during a BAM transmission
could stall the socket queue, preventing further transmissions even
after the bus error is resolved. The fix activates the next queued
session after the error recovery, allowing communication to continue.

Fixes: 9d71dd0c70099 ("can: add support of SAE J1939 protocol")
Cc: stable@vger.kernel.org
Reported-by: Alexander Hölzl <alexander.hoelzl@gmx.net>
Tested-by: Alexander Hölzl <alexander.hoelzl@gmx.net>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/all/20240528070648.1947203-1-o.rempel@pengutronix.de
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/can/j1939/transport.c

index 42fb83605d4c265e44790c6157b353fd35c778a4..6329c6abab15c952e3a7359f6cd8d8a6b0d29efd 100644 (file)
@@ -1662,6 +1662,8 @@ static int j1939_xtp_rx_rts_session_active(struct j1939_session *session,
 
                j1939_session_timers_cancel(session);
                j1939_session_cancel(session, J1939_XTP_ABORT_BUSY);
+               if (session->transmission)
+                       j1939_session_deactivate_activate_next(session);
 
                return -EBUSY;
        }