Re: [PATCH v2 0/3] Update aliases when added or removed

From: Rob Herring
Date: Tue Nov 12 2024 - 08:41:06 EST


On Sat, Nov 9, 2024 at 1:52 PM Ayush Singh <ayush@xxxxxxxxxxxxxxx> wrote:
>
> Currently the list of aliases is not updated when a DT overlay that adds
> an alias is loaded or unloaded. This break drivers (e.g. serial) that
> rely on of_alias_get_id().

Drivers use the non-existent alias numbers for instances without an
alias. So what happens if an index is already in use and then an
overlay uses the same index.

I don't see how this can work reliably unless the alias name doesn't
exist in the base DT.

> This picks up the original patch series from Geert Uytterhoeven.
>
> I have not added unittests in this version since I am not sure if kunit
> tests should be added, or if the runtime unittests (CONFIG_OF_UNITTEST)
> need to be added. Additionally, it would be great if someone can inform
> me how to run the runtime unittests since the unittests seem to fail in
> my current setup (tried running on qemu x86_64 and beagleplay).

You enable the config and boot.

Rob