mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexander Hölzl" <alexander.hoelzl@gmx.net>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: robin@protonic.nl, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de, linux-can@vger.kernel.org
Subject: Re: [PATCH] Fix J1939 implementation not handling holds correctly
Date: Sat, 16 May 2026 16:58:56 +0200	[thread overview]
Message-ID: <66ed0833-b30a-4f34-a08e-59931cf9d90c@gmx.net> (raw)
In-Reply-To: <aftAQHcRYhw1PO8B@pengutronix.de>

Hi thank you for your review!
I've sent another patch addressing all the points related to the first 
version of the patch.

On 5/6/26 15:21, Oleksij Rempel wrote:
> On Tue, May 05, 2026 at 12:18:33AM +0200, Alexander Hölzl wrote:
>> The J1939 protocol allows the receiver of directed segemented messages
>> to hold the data transfer. The kernel implementation did not handle hold
>> messages correctly was not able to resume from a hold.
>> Additionally the incorrect timeout for a held open connection was
>> changed to 1050ms.
>> Some simple tests for the general protocol behavior have been added.
>>
>> This is just an initial draft I'm just looking for some feedback
>> if the general setup is acceptable.
>>
>> Also I still have some points I'm not sure about.
>> 1. There is no check for the reception of a CTS during an ongoing data
>>     transfer. According to the standard it is illegal, but I dont think
>>     the implementation cares about it. J1939_XTP_ABORT_GENERIC is never
>>     referenced and the previous check I removed only really prevented
>>     consecutive CTS which are legal if they are holds. Should I add a
>>     check for this? This seems to be a slightly different problem so I
>>     did not address it.
> 
> Current I do not have opinion about this. As long as it is in a separate
> patch with enough explanation and tests - I'm OK.
Ok, I'll think about it and send a patch.>
>> 2. Should userspace be notified about holds? I don't think the standard
>>     gives a maximum 'hold open time' so in theory it could be held
>>     indefinetly. This might be a situation a user could be intrested in
>>     even though it is rather theoretical.
> 
> Yes, it will be good to have a user space feedback. But, it would block
> resources. Will we get difference scenarios where we still have an open
> session which is blocking other transfers?
> 
Hm I'm not quite sure if I understand your question, but a J1939 session 
is identified by source and destination address. A hold is only relevant 
for a single unicast session, so receiving hols will only block this 
specific session. As the kernel will never send holds itself this is 
only relevant for tx-sessions. So the only thing which could happen, is 
that a receiver prevents a unicast tx-session from completing by sending 
nonstop holds.
This should not impact other sessions but it will prevent this specific 
session from completing and therefore restarting another tx RTS/CTS 
session to the same destination.

The other points I addressed in the v2 patch.

...

> 
> Best Regards,
> Oleksij

Best Regards and have a nice weekend!

Alexander

      reply	other threads:[~2026-05-16 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 22:18 Alexander Hölzl
2026-05-06 13:21 ` Oleksij Rempel
2026-05-16 14:58   ` Alexander Hölzl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66ed0833-b30a-4f34-a08e-59931cf9d90c@gmx.net \
    --to=alexander.hoelzl@gmx.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=robin@protonic.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®