Repository navigation
dt-bindings: apple: T6040 PHY and dwc3 tunables: one type each (fix dtbs_check crash) - #414
Merged
RyanTheTide merged 2 commits intoOct 24, 2026
Conversation
The T6040 PHY tunables are described by a single patternProperty of type
uint32-matrix. dtschema resolves the type of a property by its exact
name first and only falls back to the patternProperties of all bindings
when no binding names it. apple,pmp.yaml has the catch-all pattern
'^apple,tunable-' of type uint8-array, so every tunable that is only
matched by a pattern gets two types, and dt-validate (dtschema 2026.9)
aborts while decoding the first such property it finds:
Could not decode node phy@382a90000 property apple,tunable-common-cfg ...
File ".../dtschema/dtb.py", line 185, in prop_value
if len(p) / type_format[fmt].size >= min_dim:
KeyError: 'uint8-array'
apple,tunable-axi2af and apple,tunable-fabric were not affected only
because apple,atcphy.yaml and apple,pcie.yaml already name them.
List the tunables as properties sharing one definition, as
apple,atcphy.yaml does, so that each has the single type uint32-matrix.
Fixes: ca86efe ("dt-bindings: phy: Add the Apple T6040 Type-C PHY")
Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com>
The T6040 controller tunables are described by a single patternProperty of type uint32-matrix. As the catch-all pattern '^apple,tunable-' of apple,pmp.yaml has the type uint8-array and dtschema only consults patterns for names no binding lists, these properties get two types and dt-validate (dtschema 2026.9) aborts while decoding them: Could not decode node usb@382280000 property apple,tunable-gbl-default KeyError: 'uint8-array' List the tunables as properties sharing one definition so that each has the single type uint32-matrix. Fixes: 4c3fb4f ("dt-bindings: usb: apple,dwc3: Add T6040") Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com>
Author
|
Reopening: the crash is still there on the current Retest on
|
RyanTheTide
approved these changes
Oct 24, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
Thanks, good catch. Our gate runs hit the same KeyError on t6040-j616s and we'd missed it: the other DTBs validated, so the abort was buried in the log. With this merged onto integration/aurora 2e9e457 (dtschema 2026.9), dt_binding_check on both bindings is clean, all 116 Apple DTBs validate, there's no KeyError or decode error, and t6040-j616s now gets its 42 reports, none of them about the PHY or USB tunables. Only the two T6040 bindings change. Merging.
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dtbs_checkon t6040-j616s aborts since #403 (also noted in #412), so the J616s tree can't be validated:Cause. dtschema takes a property's type from a binding that names it exactly. Only when no binding names it does it collect the types of every binding's patternProperties.
apple,pmp.yamlhas the catch-all'^apple,tunable-'with typeuint8-array. #403 describes the T6040 PHY and dwc3 tunables only through a pattern, with typeuint32-matrix. So those names get both types, and dt-validate crashes while decoding them.apple,tunable-axi2afand-fabricdecode only becauseapple,atcphy.yamlandapple,pcie.yamlalready name them. Fixing only the PHY binding moves the same crash tousb@382280000apple,tunable-gbl-default, so both bindings need the change.Fix. Two commits, binding YAML only. Each tunable becomes an explicit property that refers to one shared
$defsentry (uint32-matrix, offset/mask/value rows), asapple,atcphy.yamlalready does. The accepted values are unchanged, and the DTS doesn't change.How tested (dtschema 2026.9, on
integration/aurora1aa285750):CHECK_DTBS=y apple/t6040-j616s.dtbapple/*.dtbdt_binding_checkon both bindingscheckpatch --strictThe 42 remaining reports are the same list that a dtschema without the crash prints before this change. None of them are about USB or the PHY. They are the missing macaudio/AOP schemas and
dai-tdm-*on the dai-link,ti,sn012776withSDZ-supplyandapple,sdz-group-fail-closed(#406),nonposted-mmioon t6041 nodes, brcm wifi/bt,wifi-clkreq,mtp/tp-accel(#409), andsound-name-prefixon cs42l84.Also: dtschema itself should report conflicting types instead of crashing. Line 185 of
dtschema/dtb.pyindexestype_format[fmt], where line 220 usesfmt.split('-', 1)[0]. That belongs upstream in dtschema and isn't part of this PR.