overlay: Resolve phandle fixups in child nodes#765
Open
arthokal wants to merge 1 commit into
Open
Conversation
Phandle fixups (0xffffffff placeholders) were only resolved for direct properties of the __overlay__ node. Properties on child nodes (e.g., xlnx,memory-region in zyxclmm_drm) were deep-copied with unresolved values, causing them to be silently dropped at write time. Fix this by iterating label_to_fixups and patching nodes via ov_tree[path] directly, which resolves fixups across __overlay__ and all its children in one pass before any copying happens. Signed-off-by: Aravind Thokala <aravind.thokala@amd.com>
Contributor
Author
|
@onkarharsh, |
Collaborator
|
The current resolution architecture was on purpose and should only be done on write time. I don't have access to my full setup to test this, as I'm on vacation this week. Does this change preserve the phandle resolution at write time ? I can't tell from looking at the patch. Could you also attach some sample inputs and expected outputs ? So I can reproduce and test the issue myself. |
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.
Issue:
When user overlay files (passed via
-i) contain child nodes with phandle references, those references are silently dropped in the generated pl.dtsiFor example,
updated_zocl.dtsicontains:The generated overlay has
zyxclmm_drmwithxlnx,memory-regionmissing.Root Cause:
_unwrap_overlay_tree()inlopper/__init__.pyresolves0xffffffffphandle placeholders (left by dtc plugin compilation) only for direct properties of the__overlay__node.Child node properties (like those in
zyxclmm_drm) are deep-copied as-is with unresolved0xffffffffvalues, which are silently dropped at write time.Fix:
Instead of iterating properties and searching for matching fixups (inside-out), iterate
label_to_fixupsand patch nodes directly viaov_tree[path] (outside-in). This resolves phandles acrossoverlay` and all its children in one pass before any copying happens.Example Lopper command: