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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Jun 2021 18:12:49 +0530
From:   Pratyush Yadav <p.yadav@...com>
To:     Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
CC:     Maxime Ripard <mripard@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Kishon Vijay Abraham I <kishon@...com>,
        Vinod Koul <vkoul@...nel.org>,
        Peter Ujfalusi <peter.ujfalusi@...il.com>,
        Steve Longerbeam <slongerbeam@...il.com>,
        Benoit Parrot <bparrot@...com>, <linux-media@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-phy@...ts.infradead.org>, <dmaengine@...r.kernel.org>,
        Vignesh Raghavendra <vigneshr@...com>,
        Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH v2 10/18] media: cadence: csi2rx: Populate subdev devnode

On 28/05/21 10:35AM, Tomi Valkeinen wrote:
> On 28/05/2021 10:24, Pratyush Yadav wrote:
> > On 28/05/21 10:16AM, Tomi Valkeinen wrote:
> > > On 26/05/2021 18:23, Pratyush Yadav wrote:
> > > > The devnode can be used by media-ctl and other userspace tools to
> > > > perform configurations on the subdev. Without it, media-ctl returns
> > > > ENOENT when setting format on the sensor subdev.
> > > > 
> > > > Signed-off-by: Pratyush Yadav <p.yadav@...com>
> > > > ---
> > > > 
> > > > (no changes since v1)
> > > > 
> > > >    drivers/media/platform/cadence/cdns-csi2rx.c | 1 +
> > > >    1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
> > > > index 1df21f462f3c..49bed63d5faa 100644
> > > > --- a/drivers/media/platform/cadence/cdns-csi2rx.c
> > > > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c
> > > > @@ -613,6 +613,7 @@ static int csi2rx_probe(struct platform_device *pdev)
> > > >    	csi2rx->pads[CSI2RX_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> > > >    	for (i = CSI2RX_PAD_SOURCE_STREAM0; i < CSI2RX_PAD_MAX; i++)
> > > >    		csi2rx->pads[i].flags = MEDIA_PAD_FL_SOURCE;
> > > > +	csi2rx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> > > >    	ret = media_entity_pads_init(&csi2rx->subdev.entity, CSI2RX_PAD_MAX,
> > > >    				     csi2rx->pads);
> > > > 
> > > 
> > > I don't understand this one. There's nothing to configure in cdns-csi2rx
> > > from userspace, as far as I can see, so why is the dev node needed? And why
> > > would the lack of csi2rx dev node cause sensor subdev config to fail?
> > 
> > Sensor config does not fail. But when I run media-ctl to set the format
> > on /dev/media0, I get an error message that comes because the devnode
> > for the bridge does not exist. I was not 100% sure about this patch but
> > I figured if media-ctl expects it then it should be exposed.
> > 
> > I don't mind dropping this patch. Just want to make sure what the right
> > thing to do here is. Should every element of the pipeline have a devnode
> > or not?
> 
> Tbh, I don't know. But I don't see why they should have. Also, my test works
> fine if I remove the devnode here.
> 
> What media-ctl parameters did you use which fails?

Media controller topology:

  root@...evm:~# media-ctl -p
  Media controller API version 5.13.0
  
  Media device information
  ------------------------
  driver         j721e-csi2rx
  model          TI-CSI2RX
  serial
  bus info       platform:4500000.ticsi2rx
  hw revision    0x1
  driver version 5.13.0
  
  Device topology
  - entity 1: cdns_csi2rx.4504000.csi-bridge (5 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev0
         pad0: Sink
                 <- "ov5640 9-003c":0 [ENABLED,IMMUTABLE]
         pad1: Source
                 -> "j721e-csi2rx":0 [ENABLED,IMMUTABLE]
         pad2: Source
         pad3: Source
         pad4: Source
  
  - entity 7: ov5640 9-003c (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev1
         pad0: Source
                 [fmt:UYVY8_2X8/640x480@...0 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
                 -> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE]
  
  - entity 11: j721e-csi2rx (1 pad, 1 link)
              type Node subtype V4L flags 0
              device node name /dev/video0
         pad0: Sink
                 <- "cdns_csi2rx.4504000.csi-bridge":1 [ENABLED,IMMUTABLE]


Setting resolution on the sensor (with cdns-csi2rx devnode present):

  root@...evm:~# media-ctl --set-v4l2 '"ov5640 9-003c":0 [fmt:UYVY8_2X8/1920x1080@...0]'

The above command works. Setting resolution on the sensor (without the 
devnode present):

  root@...evm:~# media-ctl --set-v4l2 '"ov5640 9-003c":0 [fmt:UYVY8_2X8/1920x1080@...0]'
  Unable to setup formats: No such file or directory (2)

This sets the format correctly on the sensor but fails when it tried to 
set it on the bridge.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ