Repository navigation
dt-checks: document disk-boot and subtract in-tree /chosen bindings - #3122
Conversation
Upstream dtschema's chosen.yaml sets additionalProperties: false, so dt-validate still reports every in-tree /chosen property (even those documented under Documentation/devicetree/bindings/chosen/*.yaml as in PR #3106) as not matching any regex in chosen.yaml. Adding another documented /chosen property (such as linux-enablement-mac,dapf-halted-handoff in #2745 for t8132-j715.dtb) changes the quoted property list in that warning line, causing apple-dt-check.sh to fail with a false positive. Fix this without shadowing upstream chosen.yaml: - Document linux-enablement-mac,disk-boot (used in t8132-jxxx.dtsi) in Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yaml. - In scripts/dtc/apple-dt-check.sh, parse properties documented under Documentation/devicetree/bindings/chosen/*.yaml for each checked revision and subtract only those documented property names from 'chosen: ... do(es) not match any of the regexes:' lines. Lines are dropped only when every listed property is documented in bindings/chosen/*.yaml. Any undocumented /chosen property remains reported (with singular/plural verb normalized), and all non-/chosen warnings and schema type/value checks continue to fail as before. Signed-off-by: Diljit Singh <[email protected]>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…errors Fix two review issues in scripts/dtc/apple-dt-check.sh: 1. Check filter_documented_chosen (and the warning extraction pipeline) exit status explicitly for both BASE and HEAD before comparing warning lists. Previously a failing filter (for example when neither PyYAML nor ruamel.yaml is available) exited non-zero inside the pipeline while sort wrote an empty warning file and warnings() returned make's exit status, silently dropping HEAD warnings with exit status 0. Fail immediately with a clear stderr message on any filter failure, while cleaning up the BASE worktree via an EXIT trap. 2. Run filter_documented_chosen on the raw CHECK_DTBS log (with make -Otarget to prevent parallel interleaving) before grep/perl strip 'from schema $id:' and regex tails, and subtract bindings/chosen/*.yaml properties only when the warning carries upstream chosen.yaml's exact schema ID (http://devicetree.org/schemas/chosen.yaml#). Warnings from any other schema ID or with no schema ID are left untouched. Signed-off-by: Diljit Singh <[email protected]>
|
Addressed both review findings in follow-up commit
Verified locally with |
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 6b91bfb1ee33
Blockers: none
Checked: full diff across Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yaml and scripts/dtc/apple-dt-check.sh; 7/7 parser edge-case self-tests; CI checks
Evidence
linux-enablement-mac,disk-boot.yamldefines the boolean/chosenproperty cleanly withadditionalProperties: true.filter_documented_chosen()inscripts/dtc/apple-dt-check.shparses in-treebindings/chosen/*.yaml(excluding$-prefixed keys andfalseproperties), subtracts only documented properties fromhttp://devicetree.org/schemas/chosen.yaml#unmatched-regex warnings, preserves all undocumented property warnings, type/value schema warnings, and other schema IDs, and fails loudly if neither PyYAML norruamel.yamlis available.- CI checks: 4/4 green (
dt-checks,host-tests,readiness,pr-text) at6b91bfb1ee33.
Summary
Follow-up to #3106 fixing the
/chosendt-checksfalse positive that blocks #2745 (t8132-j715.dtb), without shadowing upstreamdtschema'schosen.yaml:Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yaml: document the booleanlinux-enablement-mac,disk-boot/chosenflag used inarch/arm64/boot/dts/apple/t8132-jxxx.dtsi.scripts/dtc/apple-dt-check.sh: parse property names documented underproperties:in each revision'sDocumentation/devicetree/bindings/chosen/*.yamland subtract only those documented names fromchosen: ... do(es) not match any of the regexes:lines.Strict enforcement is preserved:
chosen: ... do(es) not match any of the regexes:line is dropped only when every listed property is documented inbindings/chosen/*.yaml./chosen, the warning is preserved/rewritten for the undocumented property(ies) (normalizingdoes/do) sodt-checksstill fails./chosenwarnings and all schema type/value checks frombindings/chosen/*.yaml(e.g. non-booleanlinux-enablement-mac,disk-boot) remain untouched and continue to faildt-checks.Risk
CHECK_DTBSanddt_binding_check) only.Tested
cd47c16c4edb21cc9d54db2236772965cc0b0eaa:bash -n scripts/dtc/apple-dt-check.shpassed.yamllint -c Documentation/devicetree/bindings/.yamllint Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yamlpassed with zero warnings.dt-doc-validateanddt-mk-schemapassed with zero errors and zero stderr warnings (no duplicate$id).dt-validateon synthetic DTBs plus filter self-tests (under both PyYAML andruamel.yaml) verified: (a) all 4 documentedlinux-enablement-mac,*properties are subtracted cleanly, (b) mixing in 1 or 2 undocumented properties still fails withdoes/do, (c) non-/chosenwarnings,/chosensubnode warnings, and type-mismatch errors onlinux-enablement-mac,disk-bootremain untouched.CHECK_DTBSacross all Apple DTBs anddt_binding_checkrun via PRdt-checksCI.Not yet