[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWiCz7yZyAvJwPNU@zatzit>
Date: Thu, 15 Jan 2026 17:01:51 +1100
From: David Gibson <david@...son.dropbear.id.au>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Ayush Singh <ayush@...gleboard.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
devicetree-compiler@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree-spec@...r.kernel.org,
Hui Pu <hui.pu@...ealthcare.com>,
Ian Ray <ian.ray@...ealthcare.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [RFC PATCH 23/77] dtc: Introduce mark_local_exports()
On Mon, Jan 12, 2026 at 03:19:13PM +0100, Herve Codina wrote:
> In order to have correct tags set in dtb, an export symbol has to
> be identified as a "local" export symbol when it references a local
> node.
>
> This is done for phandles used by properties in mark_local_phandles().
>
> The same operation is needed for export symbols. This is the purpose of
> mark_local_exports().
Again, I don't like caching this information. Can you determine this
just at the time you specifically use it?
>
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
> ---
> dtc.c | 2 ++
> dtc.h | 2 ++
> livetree.c | 23 +++++++++++++++++++++++
> 3 files changed, 27 insertions(+)
>
> diff --git a/dtc.c b/dtc.c
> index fe8e8e4..030bfa2 100644
> --- a/dtc.c
> +++ b/dtc.c
> @@ -336,6 +336,8 @@ int main(int argc, char *argv[])
> update_phandles_ref(dti);
> mark_local_phandles(dti);
>
> + mark_local_exports(dti);
> +
> /*
> * With FDT_REF_PHANDLE added in dtbs, we need to identified
> * if some unresolved phandle references are allowed in the dtb
> diff --git a/dtc.h b/dtc.h
> index 0bf5ba5..ea073c2 100644
> --- a/dtc.h
> +++ b/dtc.h
> @@ -368,6 +368,8 @@ void generate_local_fixups_tree(struct dt_info *dti, const char *name);
> void update_phandles_ref(struct dt_info *dti);
> void mark_local_phandles(struct dt_info *dti);
>
> +void mark_local_exports(struct dt_info *dti);
> +
> /* Checks */
>
> void parse_checks_option(bool warn, bool error, const char *arg);
> diff --git a/livetree.c b/livetree.c
> index 4458437..0e756b8 100644
> --- a/livetree.c
> +++ b/livetree.c
> @@ -1303,3 +1303,26 @@ void mark_local_phandles(struct dt_info *dti)
> {
> mark_local_phandles_internal(dti, dti->dt);
> }
> +
> +static void mark_local_exports_internal(struct dt_info *dti,
> + struct node *node)
> +{
> + struct node *c;
> + struct symbol *exportsym;
> + struct node *refnode;
> +
> + for_each_symbol(node->exportsymlist, exportsym) {
> + refnode = get_node_by_ref(dti->dt, exportsym->ref);
> + if (refnode)
> + exportsym->is_local = true;
> + }
> +
> + for_each_child(node, c)
> + mark_local_exports_internal(dti, c);
> +}
> +
> +void mark_local_exports(struct dt_info *dti)
> +{
> + mark_local_exports_internal(dti, dti->dt);
> +
> +}
> --
> 2.52.0
>
>
--
David Gibson (he or they) | 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
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists