Repository navigation
scripts/dtc: apple-dt-check: validate only the DTBs a change alters - #3804
RyanTheTide wants to merge 2 commits into
Conversation
Device tree checks ran CHECK_DTBS (dt-validate) on all 141 Apple DTBs at both the base and the head of every change. Schema validation is most of the job's time, and a runner spends up to ~40 minutes on it even for a one-board change. Compile every Apple DTB at both revisions without schema checks first and validate only the DTBs whose compiled bytes differ, widened to their firmware-profile variant family (a variant's warnings are reported under its base board's name). An identical DTB against identical bindings gives identical warnings, so the new/removed lists are unchanged. A change to the bindings, scripts/ or the top Makefile, a DTB build failure, or a DTB missing from the build validates every Apple DTB as before. The work directory is made absolute, since kbuild resolves a relative O= against the -C tree.
RyanTheTide
left a comment
There was a problem hiding this comment.
Reproduced a warning the hash filter drops. On the current t6031-j514c DTS, adding -Wunit_address_vs_reg to DTC_FLAGS_t6031-j514c in arch/arm64/boot/dts/apple/Makefile emits unit_address_vs_reg for /soc/smc@2a4400000/gpio@67500000 with byte-identical DTBs. The old gate includes that compiler warning. This head neither triggers the full-check fallback for that Makefile nor extracts warnings from the first-pass build log, so it skips the board. Include DT build Makefiles in the full-check fallback.
A Makefile can turn on a dtc warning (DTC_FLAGS_<board>) without changing any DTB's bytes, so the changed-DTB selection skipped a board the full check would have reported: with -Wunit_address_vs_reg added for t6031-j514c, its unit_address_vs_reg warnings went missing. Feed the first pass's build log, which has dtc's own warnings for every Apple DTB, into each side's warning list, and validate every DTB again when any Makefile or Kbuild file changes.
DjDeveloperr
left a comment
There was a problem hiding this comment.
The fallback conflates GNU make's DTB build error (exit 2) with prepare()'s checkout/defconfig sentinel. I reproduced a base-only DTB failure with successful checkout/defconfig and a clean head: the old script exits 0, while this head says BASE could not be checked out and exits 1 with zero new warnings. Please give setup failure a separate status, while retaining the full-validation fallback on either build failure. Both commits also need their human Signed-off-by trailers.
|
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. |
|
Replaced by #3826: one commit with its Signed-off-by, plus the fixes for both review findings. The checkout/defconfig failure now has its own status, distinct from make's exit 2. |
What:
scripts/dtc/apple-dt-check.sh(the Device tree checks job) ranCHECK_DTBSon all 141 Apple DTBs at both base and head for every DT change. On the box runners that's up to ~40 minutes per job, mostlydt-validate. It now compiles every Apple DTB at both revisions without schema checks first, then validates only the DTBs whose compiled bytes differ, widened to their firmware-profile variant family (a variant's warnings are reported under its base board's name). An identical DTB against identical bindings gives identical warnings, so the new/removed lists don't change. dtc's own warnings (from the first, compile-only pass) are still compared for every DTB, as before. The script falls back to validating every DTB, as before, when any of these happen:scripts/, or any Makefile/Kbuild file changes (a Makefile can changeDTC_FLAGSwithout changing DTB bytes);The work directory is made absolute, because kbuild resolves a relative
O=against the-Ctree.Tested: buildbox, dtschema 2026.9, old script (main
cafee219) vs this one on the same base/head:t6030-j514s.dtsonly): 1 of 141 DTBs checked. 0 new / 0 removed, same as old. base and head warning lines for that board are identical to the old run's (59). 108 s vs 191 s.t8112.dtsi): 8 of 141 DTBs checked (the T8112 boards). 0/0, same as old. Warning lines identical for the 8 boards. 158 s vs 252 s.t8122-j613-25g83.dtschecks 2 DTBs (the variant and its base board) and reports the same 2 new warnings undert8122-j613.dtbas the old script (new.warnidentical). Exit 1 in both.-Wunit_address_vs_regadded toDTC_FLAGS_t6031-j514c(byte-identical DTBs) gives 4 new warnings, exit 1, through the Makefile fallback. With that fallback disabled, the build-log path alone finds the same 4 in 32 s.The buildbox has 32 threads. Runner VMs have far fewer, so validation is a bigger share of the job there and the saving is larger.
Risk: two-way. Only
scripts/dtc/apple-dt-check.shchanges. A wrong selection could miss a new warning; the fallbacks above cover the inputs that can change warnings without changing DTB bytes (bindings, dtschema and dtc scripts). This PR changesscripts/, so its own run validates every DTB. Revert:git revert -m 1 <merge-sha>.Not yet: the dtschema version is pinned by pip at run time and is the same for base and head in one job, so it doesn't affect the comparison.