Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH] can: j1939: fix wrong rx timeout for CTS hold messages
@ 2026-04-21 15:31 Alexander Hölzl
  2026-04-23  3:50 ` Oleksij Rempel
  2026-05-06 12:54 ` Marc Kleine-Budde
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Hölzl @ 2026-04-21 15:31 UTC (permalink / raw)
  To: robin, o.rempel; +Cc: kernel, linux-can, linux-kernel, Alexander Hölzl

In J1939 segmented transport, a CTS message with data byte 2 set to zero is interpreted as a hold message.
This instructs the transmitter of the segmented message to hold the connection open but to delay sending.
According to the J1939-21 standard, section 5.10.2.4 the timeout T4 after which an held open session is invalidated is
1050 ms, not 550 as implemented currently.
The 550 ms are problematic if a device uses hold messages and assumes it can wait for more than 550 ms before it has
to resend the hold message.

This patch changes the T4 timeout used in the implementation from 550 ms to 1050.

Signed-off-by: Alexander Hölzl <alexander.hoelzl@gmx.net>
---
 net/can/j1939/transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index df93d57907da..7ad56b5f17b9 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -1479,7 +1479,7 @@ j1939_xtp_rx_cts_one(struct j1939_session *session, struct sk_buff *skb)
 		}
 	} else {
 		/* CTS(0) */
-		j1939_tp_set_rxtimeout(session, 550);
+		j1939_tp_set_rxtimeout(session, 1050);
 	}
 	return;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-05-06 12:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 15:31 [PATCH] can: j1939: fix wrong rx timeout for CTS hold messages Alexander Hölzl
2026-04-23  3:50 ` Oleksij Rempel
2026-04-23  9:35   ` Hölzl, Alexander
2026-04-23 13:07     ` Oleksij Rempel
2026-04-23 13:34       ` Hölzl, Alexander
2026-05-06 12:54 ` 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