devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: PCI schema accepts unevaluated properties
Date: Wed, 27 Apr 2022 09:53:02 -0500	[thread overview]
Message-ID: <CAL_Jsq+d-RHNnTyy+mrs2L7Zycjwq07vENCH8+SHZBuZGCuq=A@mail.gmail.com> (raw)
In-Reply-To: <345716e9-5624-5ba0-09f0-46e9850c546c@linaro.org>

On Wed, Apr 27, 2022 at 1:29 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 27/04/2022 04:36, Rob Herring wrote:
> > On Sat, Apr 23, 2022 at 5:46 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> Hi Rob,
> >>
> >> Dmitry pointed out interesting issue when writing PCI schema. Consider
> >> the patch for Exynos PCI schema (which includes SNPS schema and
> >> unevaluatedProperties:false):
> >> https://pastebin.ubuntu.com/p/4SzxVP4N3j/
> >>
> >> This passes `make dt_binding_check
> >> DT_SCHEMA_FILES=Documentation/devicetree/bindings/pci/` without a
> >> problem. It should not. The property is nowhere described, so
> >> unevaluatedProperties should scream.
> >>
> >> Other bindings using unevaluated:false and some ref, also has this
> >> issue. The additionalProperties:false (when there is no ref for other
> >> schema) works correct.
> >
> > This is because I never committed the fix for all this which explains the issue:
> >
> >     dtschema: Strip 'additionalProperties: true' from schemas
> >
> >     An 'additionalProperties: true' makes all properties evaluated, so an
> >     'unevaluatedProperties: false' schema doesn't work when referencing a
> >     schema with 'additionalProperties: true'.
> >
> >     Really, 'additionalProperties: true' should be dropped, but it is used as
> >     a flag for common schemas which are usually incomplete and included by
> >     device specific schemas. Removing it would mean dropping the meta-schema
> >     requiring either 'additionalProperties' or 'unevaluatedProperties'.
> >
> >     Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Since snps,dw-pcie.yaml defines 'additionalProperties: true',
> > everything is evaluated...
>
> Thanks for explanation.
>
> >
> > This fix needed schema fixes to land before I committed this, but it
> > was the end of the year and I guess I forgot about it. Now, it looks
> > like we have more to fix. :(  25 to be exact:
> >
> > Documentation/devicetree/bindings/mfd/samsung,exynos5433-lpass.example.dtb:
> > audio-subsystem@11400000: dma-controller@11420000: Unevaluated
> > properties are not allowed ('#dma-channels', '#dma-requests',
> > 'power-domains' were unexpected)
>
> I'll fix the power-domains, but dma-channels/dma-requests should not
> fail. This should be accepted through:
> arm,pl330.yaml -> dma-controller.yaml -> dma-common.yaml

Except that the standard property names are 'dma-channels' and
'dma-requests' without the '#'.

Thanks for the fixes. Unfortunately, it looks like NAND needs the same
parent/child schema split that was done for SPI.

Rob

  reply	other threads:[~2022-04-27 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 10:46 PCI schema accepts unevaluated properties Krzysztof Kozlowski
2022-04-27  2:36 ` Rob Herring
2022-04-27  6:29   ` Krzysztof Kozlowski
2022-04-27 14:53     ` Rob Herring [this message]
2022-04-27 15:04       ` Krzysztof Kozlowski

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='CAL_Jsq+d-RHNnTyy+mrs2L7Zycjwq07vENCH8+SHZBuZGCuq=A@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=krzysztof.kozlowski@linaro.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;
as well as URLs for NNTP newsgroup(s).