On Sun, Feb 25, 2024 at 06:54:23PM +0100, Uwe Kleine-König wrote: > A phandle in an overlay is not supposed to overwrite a phandle that > already exists in the base dtb as this breaks references to the > respective node in the base. > > So add another iteration over the fdto that checks for such overwrites > and fixes the fdto phandle's value to match the fdt's. > > A test is added that checks that newly added phandles and existing > phandles work as expected. > > Signed-off-by: Uwe Kleine-König > --- > Hello, > > here comes the next iteration of the patch that fixes overlay > application to not overwrite existing phandles. > > It is rebased to current main branch. The changes since v2 are: > > - Add documentation > - Apply the simplification from 24f60011fd43 ("libfdt: Simplify > adjustment of values for local fixups") in the functions added here. > - Rename functions using shorter and better names > - Changed the test device trees to yield a hole in the phandle space > - Checked each phandle value not being overwritten separately > > Note I didn't switch the order of overlay_prevent_phandle_overwrite() and > overlay_fixup_phandles() because the overlay's phandles must be resolved > before I can do the recursion needed in > overlay_prevent_phandle_overwrite(). > > Best regards > Uwe Applied, thanks. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson