From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: Theodore Tso <tytso@mit.edu>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
Roman Gushchin <roman.gushchin@linux.dev>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Derek Barbosa <debarbos@redhat.com>,
Matthieu Baerts <matttbe@kernel.org>,
Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
Jason Gunthorpe <jgg@ziepe.ca>,
Steven Rostedt <rostedt@goodmis.org>,
users@kernel.org,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Stephen Finucane <stephenfin@redhat.com>,
bpf <bpf@vger.kernel.org>, Chris Mason <clm@meta.com>,
Christian Brauner <brauner@kernel.org>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: Linking Patchwork with Sashiko?
Date: Thu, 16 Jul 2026 15:30:51 -0700 [thread overview]
Message-ID: <allajcbLlV5xwfXh@google.com> (raw)
In-Reply-To: <cd791ba9f1819528a9a964ae2ae3833c8e6c4b87.camel@ndufresne.ca>
On Thu, Jul 16, 2026 at 04:54:37PM -0400, Nicolas Dufresne wrote:
> Le mercredi 15 juillet 2026 à 23:53 -0400, Theodore Tso a écrit :
> > On Wed, Jul 15, 2026 at 11:00:54PM -0500, Nicolas Dufresne wrote:
> > > In V4L2 m2m notably, there is a "job" in the background, which allow
> > > to safely (at least this is the theory) chain up work, and
> > > synchronize against pending work. But Sashiko (and other AI) seems
> > > to not get it and state with confidence and long explanation that
> > > the drivers are racy and should do X/Y/Z more on top (and never
> > > blames the framework).
> >
> > Is there actually a race which is allowed by the framework? Or is
> > Sashiko's proposed race actually not possible?
>
> Not that I'm aware of, as long as the driver follow the conventions. A typical
> occurrence of this is when Sashiko suggest that you should do an extra worker
> cancel after streamoff. The framework already ensure, through a job wait
> mechanism, that there is no more active tasks. This allow chaining this work
> across workers, and one really done with the task, the driver will call a
> function to finish the job.
>
> Though, AI is also fed with code using the framework, but not the jobs. Venus
> and Iris from Qualcomm just leave the job running, and manually tear down and
> finish the job on streamoff. So when AI use that as example (or thinking model),
> they conclude defensive coding is needed. I bet that if Qualcomm Iris/Venus
> developer where to review other m2m they would provide similar reviews. But they
> will likely add words that show a certain level of uncertainty, very unlike
> Sashiko today.
>
> What happens is that developers endup producing defensive code for cases that
> will never occur, but it can go as far as refactoring and putting in place extra
> mechanism that are simply duplicate of the existing framework. So we receive
> more complex code, with convincing comment that does not reflect any real-life
> scenarios.
>
> Now its not a great mechanism, since its easy to "finish the job" and keep
> working, which can make the driver code run concurrently with a device_run()
> from another thread. And for multi-core drivers, its easy to forget that the
> framework does not protect anything concurrent inside your driver.
>
> Sashiko is just not doing the teaching that is needed for new contributors, or
> for experienced developers handling slightly different type of HW with this
> "problematic" framework.
So I think here you need to teach Sashiko a bit. Submit a patch to
https://github.com/masoncl/review-prompts that creates
kernel/subsystem/media.md and lists all fine points of the APIs and
common pitfalls that driver writers are often fall into. That will steer
Sashiko away from suggesting hallucinated or impossible to happen
scenarios.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2026-07-16 22:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260604085201.177ad537@foz.lan>
[not found] ` <20260607195656.02788791@foz.lan>
[not found] ` <akQlPSNfGEllNVhe@debarbos-thinkpadt14gen5.rmtusma.csb>
[not found] ` <20260710074528.5a6e4457@foz.lan>
[not found] ` <20260710083845.23c753ca@foz.lan>
[not found] ` <87wlv2jq4t.fsf@linux.dev>
[not found] ` <20260713095538.3d5e86f1@foz.lan>
[not found] ` <20260713094120.GD1127719@killaraus.ideasonboard.com>
[not found] ` <20260713220427.582b28bf@foz.lan>
[not found] ` <7ia4mrvtrxjl.fsf@castle.c.googlers.com>
[not found] ` <20260715005909.GF1656185@killaraus.ideasonboard.com>
2026-07-15 16:28 ` Linking Patchwork with Sashiko? Ihor Solodrai
2026-07-15 16:39 ` Laurent Pinchart
2026-07-15 17:12 ` Ihor Solodrai
2026-07-15 17:35 ` Mark Brown
2026-07-15 18:39 ` Ihor Solodrai
2026-07-15 20:32 ` Mark Brown
2026-07-15 19:06 ` Laurent Pinchart
2026-07-15 21:13 ` Theodore Tso
2026-07-16 3:00 ` Nicolas Dufresne
2026-07-16 3:53 ` Theodore Tso
2026-07-16 7:55 ` Mauro Carvalho Chehab
2026-07-16 20:54 ` Nicolas Dufresne
2026-07-16 22:30 ` Dmitry Torokhov [this message]
2026-07-16 6:23 ` Jai Luthra
2026-07-16 12:32 ` Theodore Tso
2026-07-15 17:41 ` Jason Gunthorpe
2026-07-15 19:10 ` Laurent Pinchart
2026-07-15 19:55 ` Mark Brown
2026-07-15 19:38 ` Dmitry Torokhov
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=allajcbLlV5xwfXh@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=clm@meta.com \
--cc=debarbos@redhat.com \
--cc=ihor.solodrai@linux.dev \
--cc=jgg@ziepe.ca \
--cc=konstantin@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=matttbe@kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=stephenfin@redhat.com \
--cc=tytso@mit.edu \
--cc=users@kernel.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