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] [day] [month] [year] [list]
Message-ID: <20220118163413.ge2b4g75yhfqvq3x@uno.localdomain>
Date:   Tue, 18 Jan 2022 17:34:13 +0100
From:   Jacopo Mondi <jacopo@...ndi.org>
To:     "Lad, Prabhakar" <prabhakar.csengg@...il.com>
Cc:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        Niklas Söderlund <niklas.soderlund@...natech.se>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Biju Das <biju.das.jz@...renesas.com>,
        linux-media <linux-media@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: dt-bindings: media: renesas,csi2: Update
 data-lanes property

Hi Prabhakar

On Tue, Jan 18, 2022 at 09:11:42AM +0000, Lad, Prabhakar wrote:
> Hi Jacopo,
>
> Thank you for the review.
>
> On Mon, Jan 17, 2022 at 8:11 AM Jacopo Mondi <jacopo@...ndi.org> wrote:
> >
> > Hello Prabhakar,
> >
> > On Thu, Jan 13, 2022 at 10:32:14AM +0000, Lad Prabhakar wrote:
> > > CSI-2 (CSI4LNK0) on R-Car and RZ/G2 supports 4-lane mode which is already
> > > handled by rcar-csi2.c driver. This patch updates the data-lanes property
> > > to describe the same.
> > >
> > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> > > ---
> > >  .../devicetree/bindings/media/renesas,csi2.yaml          | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/renesas,csi2.yaml b/Documentation/devicetree/bindings/media/renesas,csi2.yaml
> > > index e6a036721082..064a0a4c5737 100644
> > > --- a/Documentation/devicetree/bindings/media/renesas,csi2.yaml
> > > +++ b/Documentation/devicetree/bindings/media/renesas,csi2.yaml
> > > @@ -67,7 +67,14 @@ properties:
> > >                  maxItems: 1
> > >
> > >                data-lanes:
> > > -                maxItems: 1
> > > +                items:
> > > +                  minItems: 1
> > > +                  maxItems: 4
> > > +                  items:
> > > +                    - const: 1
> > > +                    - const: 2
> > > +                    - const: 3
> > > +                    - const: 4
> >
> > Seeing "maxItems: 1" there confuses me too, as the property is an
> > array of data-lanes, but I'm afraid your change does not what you
> > intend as it would allow you to specify the number of data lanes as an
> > integer rather than as an array.
> >
> Agreed, what do you think of the below instead?
>
>             properties:
>               data-lanes:
>                 minItems: 1
>                 maxItems: 4
>                 items:
>                   maximum: 4
>

Sorry, I should have read your reply first :)
even better with your suggested uniqueItems

> The above should handle all the possible mix and match of the lanes.
>
> > I think it would probably be correct to set
> >
> >                 data-lanes: true
> >
> > (maybe maxItems: 1 is correct already)
> >
> > And restrict the number of valid combinations in the board DTS file
> > with a construct like:
> >
> >     data-lanes:
> >       oneOf:
> >         - items:
> >             - const: 1
> >             - const: 2
> >             - const: 3
> >             - const: 4
> >         - items:
> >             - const: 1
> >             - const: 2
> >
> I haven't come across dts files having such constraints is it allowed,
> could you point me to a example.

I see some

Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-        properties:
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml:          data-lanes:
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-            oneOf:
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 2
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 3
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 4
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-                  - const: 2
Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml-

Documentation/devicetree/bindings/media/i2c/imx258.yaml-        properties:
Documentation/devicetree/bindings/media/i2c/imx258.yaml:          data-lanes:
Documentation/devicetree/bindings/media/i2c/imx258.yaml-            oneOf:
Documentation/devicetree/bindings/media/i2c/imx258.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 2
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 3
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 4
Documentation/devicetree/bindings/media/i2c/imx258.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/imx258.yaml-                  - const: 2

Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-        properties:
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml:          data-lanes:
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-            anyOf:
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 2
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-              - items:
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 1
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 2
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 3
Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml-                  - const: 4

But yes, most bindings simply report

              data-lanes:
                minItems: 1
                maxItems: 4

Which allows all combinations, including repetitions, so they're
probably wrong.

Thanks
  j

>
> Cheers,
> Prabhakar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ