From: Marek Szyprowski <m.szyprowski@samsung.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: devicetree-compiler@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] libfdt: place new nodes & properties after the parent's ones
Date: Mon, 10 Feb 2020 12:40:19 +0100 [thread overview]
Message-ID: <bc380fd8-71bb-897e-f060-b51386dec9be@samsung.com> (raw)
In-Reply-To: <20200205054508.GG60221@umbus.fritz.box>
Hi David,
On 05.02.2020 06:45, David Gibson wrote:
> On Tue, Feb 04, 2020 at 01:58:44PM +0100, Marek Szyprowski wrote:
>> While applying dt-overlays using libfdt code, the order of the applied
>> properties and sub-nodes is reversed. This should not be a problem in
>> ideal world (mainline), but this matters for some vendor specific/custom
>> dtb files. This can be easily fixed by the little change to libfdt code:
>> any new properties and sub-nodes should be added after the parent's node
>> properties and subnodes.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> I'm not convinced this is a good idea.
>
> First, anything that relies on the order of properties or subnodes in
> a dtb is deeply, fundamentally broken. That can't even really be a
> problem with a dtb file itself, only with the code processing it.
I agree about the properties, but generally the order of nodes usually
implies the order of creation of some devices or objects. This sometimes
has some side-effects.
For comparison, the other lib used for fdt manipulation (libufdt)
applies overlays in a such way, that the order of properties and nodes
is not reversed.
> I'm also concerned this could have a negative performance impact,
> since it has to skip over a bunch of existing things before adding the
> new one. On the other hand, that may be offset by the fact that it
> will reduce the amount of stuff that needs to be memmove()ed later on.
This code is already slow (especially in the way the uboot's use it for
'fdt apply' command), but in practice I've didn't observe negative
impact on the performance of applying large overlays at all.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2020-02-10 11:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200204125854eucas1p19ace564a5f45b9231e0fba8af07009cd@eucas1p1.samsung.com>
2020-02-04 12:58 ` Marek Szyprowski
2020-02-05 5:45 ` David Gibson
2020-02-10 11:40 ` Marek Szyprowski [this message]
2020-02-10 23:44 ` David Gibson
2020-02-11 20:29 ` Rob Herring
2020-02-12 2:09 ` David Gibson
2020-02-12 6:57 ` Marek Szyprowski
2020-02-12 19:25 ` Rob Herring
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=bc380fd8-71bb-897e-f060-b51386dec9be@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®