Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Jinseob Kim" <kimjinseob88@gmail.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v6 4/5] iio: osf: add authenticated stream parser
Date: Tue, 30 Jun 2026 00:06:23 +0100	[thread overview]
Message-ID: <20260630000623.0c030d5f@jic23-huawei> (raw)
In-Reply-To: <akJ818gkVzLN7HqU@ashevche-desk.local>

On Mon, 29 Jun 2026 17:10:31 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Mon, Jun 29, 2026 at 04:13:36AM +0900, Jinseob Kim wrote:
> > Add a UART byte-stream parser for Open Sensor Fusion frames.
> > 
> > The parser searches for the OSF0 wire magic, keeps partial frames
> > buffered, checks header length and payload bounds, and passes complete
> > candidate frames to the core decoder.
> > 
> > Rejected candidate frames drop only the current head byte before
> > resynchronizing, so a corrupted unauthenticated payload length cannot
> > make the parser skip later valid frames.  
> 
> ...
> 
> > +#define OSF_STREAM_MAGIC_LEN	4
> > +#define OSF_STREAM_MAX_PAYLOAD_LEN				\
> > +	(OSF_STREAM_MAX_FRAME_LEN - OSF_FRAME_HEADER_LEN - OSF_FRAME_CRC_LEN)
> > +
> > +static const u8 osf_stream_magic[OSF_STREAM_MAGIC_LEN] = {
> > +	'O', 'S', 'F', '0',
> > +};  
> 
> You have already this in the header (as FourCC), use that.
> 
> ...
> 
> > +static size_t osf_stream_discard_to_magic(struct osf_stream *stream)
> > +{
> > +	size_t old_len = stream->len;
> > +	size_t match_len;  
> 
> > +	size_t i;
> > +
> > +	for (i = 0; i < stream->len; i++) {  
> 
> 	for (size_t i = 0; i < stream->len; i++) {
> 
> > +		match_len = stream->len - i;
> > +		if (match_len > OSF_STREAM_MAGIC_LEN)
> > +			match_len = OSF_STREAM_MAGIC_LEN;
> > +
> > +		if (osf_stream_magic_match(stream->buf + i, match_len)) {
> > +			if (i)
> > +				osf_stream_discard(stream, i);
> > +			return i;
> > +		}
> > +	}
> > +
> > +	stream->len = 0;
> > +	return old_len;
> > +}  
> 
> ...
> 
> I stop here, because it's obvious that you neglected and ignored my previous
> reviews. No explanation given, nothing. This is not how you should interact
> with the community.
> 
> Come again when each of the given comment will be either addressed or argued.
> 
Likewise.  Please make sure to address every comment either through
changes or through reply to the earlier thread.  Perhaps some emails
have gone astray (it happens!). It can be a good idea to take a quick
look at lore.kernel.org to make sure you aren't missing any feedback
on a previous version.

Thanks,

Jonathan



  reply	other threads:[~2026-06-29 23:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 19:13 [PATCH RFC v6 0/5] iio: add Open Sensor Fusion IIO driver Jinseob Kim
2026-06-28 19:13 ` [PATCH RFC v6 1/5] dt-bindings: iio: add Open Sensor Fusion device Jinseob Kim
2026-06-28 19:19   ` sashiko-bot
2026-06-29 15:39   ` Conor Dooley
2026-06-30  5:02     ` Kim Jinseob
2026-06-28 19:13 ` [PATCH RFC v6 2/5] Documentation: iio: add Open Sensor Fusion driver overview Jinseob Kim
2026-06-29 23:02   ` Jonathan Cameron
2026-06-30  5:04     ` Kim Jinseob
2026-07-01  0:13       ` Jonathan Cameron
2026-06-28 19:13 ` [PATCH RFC v6 3/5] iio: osf: add protocol decoding Jinseob Kim
2026-06-29 14:05   ` Andy Shevchenko
2026-06-30  5:07     ` Kim Jinseob
2026-06-28 19:13 ` [PATCH RFC v6 4/5] iio: osf: add authenticated stream parser Jinseob Kim
2026-06-28 19:26   ` sashiko-bot
2026-06-29 14:10   ` Andy Shevchenko
2026-06-29 23:06     ` Jonathan Cameron [this message]
2026-06-30  5:12       ` Kim Jinseob
2026-06-30 11:56         ` Andy Shevchenko
2026-06-28 19:13 ` [PATCH RFC v6 5/5] iio: osf: add UART IIO driver Jinseob Kim
2026-06-28 19:26   ` sashiko-bot
2026-06-29 14:09 ` [PATCH RFC v6 0/5] iio: add Open Sensor Fusion " Andy Shevchenko
2026-06-29 14:12   ` Andy Shevchenko
2026-06-29 15:25 ` David Lechner
2026-06-29 16:47   ` Kim Jinseob
2026-06-29 22:58   ` Jonathan Cameron

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=20260630000623.0c030d5f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=kimjinseob88@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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