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]
Message-ID: <20210427083721.heavcdadeb4ajkk2@earth.universe>
Date:   Tue, 27 Apr 2021 10:37:21 +0200
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     skakit@...eaurora.org
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        David Collins <collinsd@...eaurora.org>, kgunda@...eaurora.org,
        Vinod Koul <vkoul@...nel.org>,
        Courtney Cavin <courtney.cavin@...ymobile.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-pm@...r.kernel.org
Subject: Re: [PATCH V2 3/4] dt-bindings: power: reset: qcom-pon: Convert qcom
 PON binding to yaml

Hi,

On Tue, Apr 27, 2021 at 11:45:44AM +0530, skakit@...eaurora.org wrote:
> Hi Sebastian,
> 
> On 2021-04-09 13:48, skakit@...eaurora.org wrote:
> > Hi Sebastian,
> > 
> > On 2021-04-08 18:30, Sebastian Reichel wrote:
> > > Hi,
> > > 
> > > On Thu, Apr 08, 2021 at 05:01:08PM +0530, satya priya wrote:
> > > > Convert qcom PON binding from .txt to .yaml format.
> > > > 
> > > > Signed-off-by: satya priya <skakit@...eaurora.org>
> > > > ---
> > > 
> > > Thanks for doing this.
> > > 
> > > > Changes in V2:
> > > >  - As per Rob's comments, converted the main PON binding and
> > > > added in V2.
> > > > 
> [...]
> > > > +  reg:
> > > > +    description: Specifies the physical address of the pon register
> > > 
> > > That description is obvious and pointless. Instead add
> > > 
> > > maxItems: 1
> > > 
> > 
> > Okay.
> > 
> > > > +  pwrkey:
> > > > +    type: object
> > > > +    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
> > > > +
> > > > +  resin:
> > > > +    type: object
> > > > +    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > > > +
> > > > +additionalProperties: true
> > > 
> > > Instead of allowing arbitrary properties, only valid modes
> > > should be allowed. So drop additionalProperties and do this
> > > instead:
> > > 
> > > allOf:
> > >   - $ref: reboot-mode.yaml#
> > > 
> > > unevaluatedProperties: false
> > > 
> > 
> > Okay.
> 
> I am not able to use 'allOf' to refer reboot-mode.yaml as some of the
> properties do not match with reboot-mode.yaml properties. Can we use oneOf
> like below?
> 
> oneOf:
>   - $ref: "reboot-mode.yaml#"
>   - $ref: "../../input/qcom,pm8941-pwrkey.yaml#"

That does not make sense.

The reference to reboot-mode.yaml is needed because it adds valid
mode properties, so that you can set unevaluatedProperties to false.
You need it at the root of the PON binding. They are not added to
the required list, so it's fine if not all of them are used. Also
there can (and usually is) more than one mode, so using oneOf is not
ok.

Last but not least the pwrkey reference is needed to describe
specific nodes (resin, pwrkey) and should not appear at the root
of the PON binding.

> Also, If I drop additionalProperties I am getting below error.
> 
> kernel/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml:
> 'additionalProperties' is a required property

You need to add 'unevaluatedProperties: false'. It is basically
the same as 'additionalProperties: false', but also accepts
properties from the referenced bindings.

Thanks,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ