New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edtlib: link child nodes to parent for nodes with child-bindings #62417
edtlib: link child nodes to parent for nodes with child-bindings #62417
Conversation
2ba5252
to
6a4a37d
Compare
@gmarull note the first two patches moves around few pinctrl nodes for ite and psoc6, this is necessary to avoid circular dependencies, could not really find any better solution to avoid that and keep those nodes under the same parent. It's not really a problem since the pin definition have no actual driver but the script does not know about that. |
6a4a37d
to
e1eeadc
Compare
e1eeadc
to
f336570
Compare
Link node properties to parent_node. Iterates over child nodes | ||
recursively if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of the function is not clear from its name and docstring; can you please expand this? The arguments are parent_node
and node
but the caller is passing node, node
. This feels confusingly written and the scope is a bit muddy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I've renamed functions and variables, added few commments, reworded the function comment and added a wrapper for the first call. Let me know if that's clear enough.
07efa9c
to
6c04f8f
Compare
6c04f8f
to
58c015a
Compare
@gmarull sorry I just re-reworded the comments. :-) |
58c015a
to
df4dc0a
Compare
df4dc0a
to
0c898b6
Compare
rebased (merge conflict in |
Refactor the pinctrl nodes slightly so that the port devices are not child of the main pinctrl node. This is because the pinctrl node is being used as parent for pinctrl setting nodes itself, and having the port nodes as child end up creating a circular depdency with the edt child enumeration patch. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Refactor the pinctrl nodes slightly so that the port devices are not child of the main pinctrl node. This is because the pinctrl node is being used as parent for pinctrl setting nodes itself, and having the port nodes as child end up creating a circular depdency with the edt child enumeration patch. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The current EDT graph logic only use properties directly under a specific node to add dependencies. For nodes properties in child-bindings, this means that the child phandles are only linked by the child node itself, which does have an ordinal but no corresponding "sturct device" in the code, causing those dependencies to be silently ignored by gen_handles.py. Fix that by adding the recursive logic to visit child bindings when present, which causes all child node property handles to be linked to the parent node. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Now that child nodes are handled by edtlib there's no need to parse child nodes in check_init_priorities anymore. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
0c898b6
to
cd62221
Compare
one more conflict, rebase again, @mbolivar-ampere ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 bot re-approval
@mbolivar-ampere ping |
Hi, this is pretty much a reiteration of #55657. At the time I did not realize that it was actually fixing an issue and dropped it, but now that we have ordinals in the device init sequence it's pretty clear that not doing this is an issue.
Example of the problem:
Before:
After:
In the first case, the missing dependency is causing the ordinal of
pwmleds
devices to be lower than thepwm
one that they depend on, that means that if they were set with the same level and priority, they would initialize in the incorrect order.Also tested on https://github.com/zephyrproject-rtos/zephyr-testing/tree/vfabio-edt-child-branch (two unrelated breakages there that don't show up on the main repo for some reason)