devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dt-validate issues with the oneOf/$ref/incomplete node
@ 2022-08-22 20:03 Dmitry Baryshkov
  2022-08-23 19:03 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2022-08-22 20:03 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-23 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-22 20:03 dt-validate issues with the oneOf/$ref/incomplete node Dmitry Baryshkov
2022-08-23 19:03 ` Rob Herring

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).