From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>
Subject: dt-validate issues with the oneOf/$ref/incomplete node
Date: Mon, 22 Aug 2022 23:03:23 +0300 [thread overview]
Message-ID: <60dc852a-a77d-cb0a-b8ee-2deef67d0b0c@linaro.org> (raw)
Hi,
Short story:
If the dt schema file has a property with using oneOf/anyOf of several
$ref references and the corresponding device node is incomplete and has
status = "disabled", then the dt-validate would still validate the node
against these schemas (and fail the validation as the node is incomplete).
Long story:
For quite a while I have been stumbling with the issue during
refactoring the display/msm/mdss schema.
The schema had the following part:
patternProperties:
"^dsi-phy@[1-9a-f][0-9a-f]*$":
oneOf:
- $ref: dsi-phy-28nm.yaml#
- $ref: dsi-phy-20nm.yaml#
- $ref: dsi-phy-14nm.yaml#
- $ref: dsi-phy-10nm.yaml#
- $ref: dsi-phy-7nm.yaml#
Validating existing DT files against just
'DT_SCHEMA_FILES=display/msm/mdss' would work w/o errors. Validating
against 'DT_SCHEMA_FILES=display/msm/dsi' would also validate w/o any
issues. However specifying 'DT_SCHEMA_FILES=display/msm' (thus enabling
both mdss.yaml and dsi-phy-*.yaml) would cause a long stream of
"mdss@ae00000: dsi-phy@ae96400: 'oneOf' conditional failed, one must be
fixed:" errors.
For quite a while I failed to understand what was causing the issue
until I found that the errors are reported against the _disabled_ device
nodes which miss e.g. several -supply nodes. If I added the
corresponding missing supplies (or removed the requirement to have the
supply from corresponding .yaml) then the file would validate against
mdss.yaml + dsi*yaml combo.
Thus I suppose something goes wrong with the validation of disabled
nodes against oneOf conditionals.
--
With best wishes
Dmitry
next reply other threads:[~2022-08-22 20:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 20:03 Dmitry Baryshkov [this message]
2022-08-23 19:03 ` dt-validate issues with the oneOf/$ref/incomplete node Rob Herring
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=60dc852a-a77d-cb0a-b8ee-2deef67d0b0c@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=robh+dt@kernel.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).