Re: [PATCH v8 1/6] of/overlay: look up absolute target-paths absolutely

From: Abdurrahman Hussain

Date: Wed Nov 18 2026 - 21:59:46 EST


On Wed, Nov 18, 2026 at 09:51:03AM -0600, Rob Herring wrote:
> The current behavior seems correct to me. The overlay should not modify
> anything above target_base. Correct or not, couldn't someone be relying
> on current behavior?

Out of tree, yes. In tree, lan966x_pci is the only caller that passes a
base, and it only uses an empty target-path.

This patch exists only for /aliases, so whether it is needed at all
depends on whether you want aliases from overlays in some form. The
case is a driver applying an overlay with its own device node as the
base:

fragment@0 {
target-path = "";
__overlay__ {
m0: i2c@1000 { ... };
};
};

fragment@1 {
target-path = "/aliases";
__overlay__ {
i2c16 = &m0;
};
};

Today fragment@1 resolves to <base>/aliases, which doesn't exist, and
the apply fails. The options I have looked at:

1) This patch: a non-empty target-path is absolute. It changes the
behavior for existing users, as you point out.

2) Leave target-path alone and handle a top-level "aliases" node in
the overlay the way "__symbols__" is handled, which already goes to
the live /__symbols__ regardless of the base:

fragment@0 { ... };

aliases {
i2c16 = &m0;
};

Such a node is ignored today, so nothing existing changes.

3) Apply with a NULL base. The overlay then has to hard-code the path
of the PCI device node, which depends on the slot.

I'd lean towards 2 and drop this patch, but I'd rather follow your
lead here. Which direction, if any, would you accept?

> If we are going to improve this, it should also define what NULL
> @target_base means.

Will do, if the kernel-doc change stays.

Thanks for applying 2/6.

Abdurrahman