From: David Gibson <david@gibson.dropbear.id.au>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Yves-Alexis Perez <corsac@debian.org>,
devicetree-compiler@vger.kernel.org, entwicklung@pengutronix.de
Subject: Re: [PATCH v3] libfdt: overlay: ensure that existing phandles are not overwritten
Date: Thu, 14 Mar 2024 20:40:48 +1000 [thread overview]
Message-ID: <ZfLUMAYG-uHeYK6N@zatzit> (raw)
In-Reply-To: <20240225175422.156393-2-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
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 <u.kleine-koenig@pengutronix.de>
> ---
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2024-03-14 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-25 17:54 [PATCH v3] libfdt: overlay: ensure that existing phandles are not overwritten Uwe Kleine-König
2024-02-26 5:53 ` David Gibson
2024-03-10 8:30 ` Uwe Kleine-König
2024-03-14 4:43 ` David Gibson
2024-03-14 9:06 ` Uwe Kleine-König
2024-03-14 10:40 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfLUMAYG-uHeYK6N@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=corsac@debian.org \
--cc=devicetree-compiler@vger.kernel.org \
--cc=entwicklung@pengutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).