Skip to content

dt-checks: document disk-boot and subtract in-tree /chosen bindings - #3122

Merged
DjDeveloperr merged 2 commits into
mainfrom
fix/dt-check-documented-chosen
Nov 25, 2026
Merged

DjDeveloperr merged 2 commits into
mainfrom
fix/dt-check-documented-chosen

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #3106 fixing the /chosen dt-checks false positive that blocks #2745 (t8132-j715.dtb), without shadowing upstream dtschema's chosen.yaml:

  • Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yaml: document the boolean linux-enablement-mac,disk-boot /chosen flag used in arch/arm64/boot/dts/apple/t8132-jxxx.dtsi.
  • scripts/dtc/apple-dt-check.sh: parse property names documented under properties: in each revision's Documentation/devicetree/bindings/chosen/*.yaml and subtract only those documented names from chosen: ... do(es) not match any of the regexes: lines.

Strict enforcement is preserved:

  • A chosen: ... do(es) not match any of the regexes: line is dropped only when every listed property is documented in bindings/chosen/*.yaml.
  • If any undocumented property appears in /chosen, the warning is preserved/rewritten for the undocumented property(ies) (normalizing does/do) so dt-checks still fails.
  • All non-/chosen warnings and all schema type/value checks from bindings/chosen/*.yaml (e.g. non-boolean linux-enablement-mac,disk-boot) remain untouched and continue to fail dt-checks.

Risk

  • Risk class: Two-way (DT binding documentation and CI check script only; no runtime kernel, DTB, or bootloader binary changes; trivially revertible).
  • Affected scope: Devicetree schema validation (CHECK_DTBS and dt_binding_check) only.

Tested

  • Verified at cd47c16c4edb21cc9d54db2236772965cc0b0eaa:
    • bash -n scripts/dtc/apple-dt-check.sh passed.
    • yamllint -c Documentation/devicetree/bindings/.yamllint Documentation/devicetree/bindings/chosen/linux-enablement-mac,disk-boot.yaml passed with zero warnings.
    • dt-doc-validate and dt-mk-schema passed with zero errors and zero stderr warnings (no duplicate $id).
    • End-to-end dt-validate on synthetic DTBs plus filter self-tests (under both PyYAML and ruamel.yaml) verified: (a) all 4 documented linux-enablement-mac,* properties are subtracted cleanly, (b) mixing in 1 or 2 undocumented properties still fails with does/do, (c) non-/chosen warnings, /chosen subnode warnings, and type-mismatch errors on linux-enablement-mac,disk-boot remain untouched.
    • Full CHECK_DTBS across all Apple DTBs and dt_binding_check run via PR dt-checks CI.

Not yet

  • No hardware boot row required (schema binding and DT check script change only; compiled DTBs are unchanged).

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]>
@DjDeveloperr
DjDeveloperr requested a review from a team as a code owner November 25, 2026 04:36
@github-actions github-actions Bot added blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 6b91bfb1: not ready yet

Check Detail
CI at head ok 3 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 6b91bfb1, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · Risk class: (DT binding documentation and CI check script only; no runtime kernel, DTB, or bootloader binary changes; trivially revertible). - Affected scope: Devicetree schema validation (CHECK_DTBS and dt_binding_check) only.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 25, 2026
…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]>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 25, 2026 05:43
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed both review findings in follow-up commit 6b91bfb1ee33e3f1e22fcc28dbe7600bf40571ee:

  1. Checked filter/pipeline exit status on both BASE and HEAD: filter_documented_chosen now runs as an explicit checked step in extract_warnings() (plus PIPESTATUS verification on the downstream grep | sed | perl | sort pipeline), and checks up front for PyYAML or ruamel.yaml. Any filter failure on BASE or HEAD aborts apple-dt-check.sh non-zero with an error on stderr before comparing warning lists, while cleaning up src-base via an EXIT trap.
  2. Scoped filtering strictly to upstream chosen.yaml: filter_documented_chosen now runs on the raw CHECK_DTBS log (with make -Otarget to avoid parallel output interleaving) before grep/perl drop from schema $id: and regex tails, and subtracts documented bindings/chosen/*.yaml properties only when the diagnostic carries from schema $id: http://devicetree.org/schemas/chosen.yaml# (supporting standard dt-validate multi-line output with optional hint: lines as well as inline from schema $id:). Warnings from any other schema ID or without a schema ID are left untouched.

Verified locally with bash -n, git diff --cached --check, yamllint, and end-to-end tests covering missing YAML loaders on BASE and HEAD, malformed YAML, chosen.yaml# subtraction (all documented, 1 and 2 undocumented, with hint: lines, and ruamel.yaml fallback), other schema IDs, warnings without a schema ID, and BASE make failures.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yaml defines the boolean /chosen property cleanly with additionalProperties: true.
  • filter_documented_chosen() in scripts/dtc/apple-dt-check.sh parses in-tree bindings/chosen/*.yaml (excluding $-prefixed keys and false properties), subtracts only documented properties from http://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 nor ruamel.yaml is available.
  • CI checks: 4/4 green (dt-checks, host-tests, readiness, pr-text) at 6b91bfb1ee33.

@DjDeveloperr
DjDeveloperr merged commit 11e708c into main Nov 25, 2026
5 checks passed
@RyanTheTide
RyanTheTide deleted the fix/dt-check-documented-chosen branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants