lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176845899846.9154.18009615769864845946@freya>
Date: Thu, 15 Jan 2026 12:06:38 +0530
From: Jai Luthra <jai.luthra@...asonboard.com>
To: Rishikesh Donadkar <r-donadkar@...com>, Tomi Valkeinen <tomi.valkeinen@...asonboard.com>, Laurent Pinchart <laurent.pinchart@...asonboard.com>, Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: y-abhilashchandra@...com, devarsht@...com, s-jain1@...com, vigneshr@...com, mchehab@...nel.org, robh@...nel.org, krzk+dt@...nel.org, p.zabel@...gutronix.de, conor+dt@...nel.org, hverkuil-cisco@...all.nl, changhuang.liang@...rfivetech.com, jack.zhu@...rfivetech.com, sjoerd@...labora.com, dan.carpenter@...aro.org, hverkuil+cisco@...nel.org, linux-kernel@...r.kernel.org, linux-media@...r.kernel.org, devicetree@...r.kernel.org, jai.luthra@...ux.dev, mripard@...nel.org
Subject: Re: [PATCH v9 06/19] media: ti: j721e-csi2rx: add a subdev for the core device

Hi Tomi,

+Sakari, Laurent

Quoting Tomi Valkeinen (2026-01-14 20:51:49)
> Hi,
> 
> On 30/12/2025 10:32, Rishikesh Donadkar wrote:
> > From: Jai Luthra <j-luthra@...com>
> > 
> > With single stream capture, it was simpler to use the video device as
> > the media entity representing the main TI CSI2RX device. Now with multi
> > stream capture coming into the picture, the model has shifted to each
> > video device having a link to the main device's subdev. The routing
> > would then be set on this subdev.
> > 
> > Add this subdev, link each context to this subdev's entity and link the
> > subdev's entity to the source. Also add an array of media pads. It will
> > have one sink pad and source pads equal to the number of contexts.
> > 
> > Support the new enable_stream()/disable_stream() APIs in the subdev
> > instead of s_stream() hook.
> > 
> > Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@...com>
> > Co-developed-by: Pratyush Yadav <p.yadav@...com>
> > Signed-off-by: Pratyush Yadav <p.yadav@...com>
> > Signed-off-by: Jai Luthra <j-luthra@...com>
> > Signed-off-by: Rishikesh Donadkar <r-donadkar@...com>
> > ---

[...]

> > @@ -981,48 +1138,52 @@ static int ti_csi2rx_link_validate(struct media_link *link)
> >       struct ti_csi2rx_ctx *ctx = container_of(vdev, struct ti_csi2rx_ctx, vdev);
> >       struct ti_csi2rx_dev *csi = ctx->csi;
> >       struct v4l2_pix_format *csi_fmt = &ctx->v_fmt.fmt.pix;
> > -     struct v4l2_subdev_format source_fmt = {
> > -             .which  = V4L2_SUBDEV_FORMAT_ACTIVE,
> > -             .pad    = link->source->index,
> > -     };
> > +     struct v4l2_mbus_framefmt *format;
> > +     struct v4l2_subdev_state *state;
> >       const struct ti_csi2rx_fmt *ti_fmt;
> > -     int ret;
> >  
> > -     ret = v4l2_subdev_call_state_active(csi->source, pad,
> > -                                         get_fmt, &source_fmt);
> > -     if (ret)
> > -             return ret;
> > +     state = v4l2_subdev_lock_and_get_active_state(&csi->subdev);
> > +     format = v4l2_subdev_state_get_format(state, link->source->index, 0);
> > +     v4l2_subdev_unlock_state(state);
> >  
> > -     if (source_fmt.format.width != csi_fmt->width) {
> > +     if (!format) {
> > +             dev_dbg(csi->dev,
> > +                     "Skipping validation as no format present on \"%s\":%u:0\n",
> > +                     link->source->entity->name, link->source->index);
> > +             return 0;
> 
> Isn't this an error?

Well, the j7 shim subdev introduced here has immutable and active links to
all the video nodes, for each DMA channel (taken from DT), many of which
may be unused for certain setups, and thus there might not be any valid
format on the subdev source pad corresponding to an unused video node.

Jacopo had a similar comment on v2, see this discussion (grep for Mali):
https://lore.kernel.org/linux-media/4mnlnsj4co3agvln4qsasmgvgwiyoo7yu2h5wyh4rmzzafhm5u@avhnbw7iknms/

I know other drivers use a different approach with mutable links, so it
would be good if you/Laurent/Sakari can give your opinions on if only one
of these two approaches should be taken for multi-stream pipelines.

> 
>  Tomi
> 

Thanks,
    Jai

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ