From: Herve Codina <herve.codina@bootlin.com>
To: Simon Glass <sjg@chromium.org>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v2 07/15] dtc: Move label-reference handling out of the grammar
Date: Fri, 6 Nov 2026 16:55:04 +0100 [thread overview]
Message-ID: <20261106165504.43b35ba2@bootlin.com> (raw)
In-Reply-To: <CAFLszTh4do1Yf0FF7LH3OpF7aOpKXpNN_fHjm0_VOY+7yLN8nQ@mail.gmail.com>
Hi Simon,
On Fri, 6 Nov 2026 06:05:52 -0700
Simon Glass <sjg@chromium.org> wrote:
...
>
> It's only very minor. For example:
>
> /plugin/;
> &foo { mine: x { a; }; };
> / { bar { }; };
> &mine { b; };
> &foo { c; };
>
> This series will have bar between fragment@0 and fragment@1, but with
> this change it comes before both fragments. I think that is fine to do
> that, just that to my mind it fits better with step 2b of David’s
> plan, where each fragment is wrapped in fragment@N after the merge.
> There are a couple of other corner cases too, which I'm looking at.
I suppose fragment@0 and fragment@1 are the overlay output dts. If so, yes,
I think also it is fine.
Still need to be acked by David.
Otherwise the solution could be to have only fragments after parsing (the
root node is a fragment).
merge_fragments() merge fragments in previous one.
The fragment list in dt_info contains orphans + the root node.
The fragments order shouldn't be modified in that case.
Then overlay_convert_output_format() will have to deal with that.
Anyway, I don't think that adding this complexity is necessary to handle
this "bar in middle" use case.
In the end, nodes are not supposed to be ordered. Anything depending on
node ordering is not correct.
IHMO, internal fragments are obviously in an ordered list (same order as
input file) but nodes in the output file don't have any order requirements
except if '--sort' option is used but it should be already ok if you perform
the sort after the overlay_convert_output_format() call.
>
> Anyway I've got a patch for your change and I'd like to put it at the
> end of the v3 series, since I am trying to move code largely unchanged
> out of the parser, avoiding behaviour changes as much as possible in
> this series. Does that sound OK?
No problem. Having it at the end of the series is ok on my side.
Best regards,
Hervé
next prev parent reply other threads:[~2026-11-06 15:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 21:17 [PATCH v2 00/15] dtc: Merge the fragments of a dts file after parsing Simon Glass
2026-11-04 21:17 ` [PATCH v2 01/15] tests: Check each error when merging a dts file Simon Glass
2026-11-04 21:17 ` [PATCH v2 02/15] srcpos: Allow srcpos_string() to accept NULL Simon Glass
2026-11-04 21:17 ` [PATCH v2 03/15] dtc: Add a struct for the top-level fragments of a dts file Simon Glass
2026-11-04 21:17 ` [PATCH v2 04/15] dtc: Move the /delete-node/ handling out of the grammar Simon Glass
2026-11-04 21:17 ` [PATCH v2 05/15] dtc: Move the /omit-if-no-ref/ " Simon Glass
2026-11-04 21:17 ` [PATCH v2 06/15] dtc: Move is_ref_relative() to livetree.c Simon Glass
2026-11-04 21:17 ` [PATCH v2 07/15] dtc: Move label-reference handling out of the grammar Simon Glass
2026-11-05 9:07 ` Herve Codina
2026-11-05 21:49 ` Simon Glass
2026-11-06 6:56 ` Herve Codina
2026-11-06 13:05 ` Simon Glass
2026-11-06 15:55 ` Herve Codina [this message]
2026-11-06 17:30 ` Simon Glass
2026-11-04 21:17 ` [PATCH v2 08/15] dtc: Merge &{label} in a plugin as with &label Simon Glass
2026-11-04 21:17 ` [PATCH v2 09/15] dtc: Move path-reference handling out of the grammar Simon Glass
2026-11-04 21:17 ` [PATCH v2 10/15] dtc: Move labelled-reference " Simon Glass
2026-11-04 21:17 ` [PATCH v2 11/15] dtc: Move first-reference " Simon Glass
2026-11-04 21:17 ` [PATCH v2 12/15] dtc: Add merge_fragment() to merge any fragment Simon Glass
2026-11-04 21:17 ` [PATCH v2 13/15] dtc: Add helpers for the errors when merging a fragment Simon Glass
2026-11-04 21:17 ` [PATCH v2 14/15] dtc: Merge the fragments of a dts file after parsing Simon Glass
2026-11-04 21:17 ` [PATCH v2 15/15] dtc: Merge the fragments of a dts file in main() Simon Glass
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=20261106165504.43b35ba2@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--cc=sjg@chromium.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