Re: [RFC PATCH 19/77] dtc: Introduce export symbols

David Gibson <[email protected]> Mon, 19 Jan 2026 16:51:21 +1100
Newsgroups org.kernel.vger.devicetree-spec,org.kernel.vger.devicetree-compiler,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <aW3GWZl8AmzsTEu0@zatzit>
On Fri, Jan 16, 2026 at 05:27:35PM +0100, Herve Codina wrote:
> Hi David,
> 
> On Thu, 15 Jan 2026 16:52:26 +1100
> David Gibson <[email protected]> wrote:
> 
> > On Mon, Jan 12, 2026 at 03:19:09PM +0100, Herve Codina wrote:
> > > Export symbols allow to define a list of symbols exported at a given
> > > node level. Those exported symbols can be used by an addon when the
> > > addon is applied on the node exporting the symbols.  
> > 
> > This seems to imply an addon always applies at a single node location.
> > I'm not sure that's a good design choice, since I don't see how it
> > covers the case of something that connects to several connectors.
> 
> Apply the addon on a node that knows about those connectors.

That seems limiting to me, because it requires the base tree to know
about all possible connector combinations, which I'm not sure is
feasible.  If I understood Geert(?)'s case properly, there are use
cases where a board might have, say, six "type foo" connectors, and an
addon board could connect to any two of those.  Of a board might have
3 "type foo" and 3 "type bar" connectors and an addon board needs to
connect to (any) of each.  It seems much more natural to me that at
attach time you say
	"addon foo 0 => board foo 1, addon foo 1 => board foo 5"
or	"addon foo 0 => board foo 2, addon bar 0 => board bar 1"

Rather than the board itself having to anticipate all combinations.

> > > In order to perform
> > > its symbol resolution. Any unresolved phandle value will be resolved
> > > using those exported symbols.
> > > 
> > > The feature is similar to __symbols__ involved with overlay but while
> > > all symbols are visible with __symbols__, only specific symbols
> > > (exported symbols) are visible with export symbols.  
> > 
> > This paragraph doesn't make sense to me.  What's a "symbol" if it's
> > not something in __symbols__ or export symbols?
> 
> An imported symbols ?
> 
> /import/ foo "blabla";
> 
> from the addon point of view where this /import/ is present, 'foo' is a
> symbol.

I guess, but existing plugin stuff doesn't really have imported
symbols, so the example doesn't really illuminate the difference from
the status quo.

> > > Also an exported symbol has a specific name and this name has to
> > > used for symbol resolution. Having this specific name allows to:
> > > 
> > >   - Have several nodes providing the same exported symbols
> > >     name but each of them pointing to different nodes.  
> > 
> > That's not a property of having a specific name, that's a property of
> > being local to a node.
> 
> Yes, exactly. I will reword.
> 
> Best regards,
> Hervé
> 

-- 
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmltxlgACgkQzQJF27ox
2GcHVA//RocgnbFaeLa/0uj7k+L+DU6kFhVse9BwrqNcnny2da/GhLnogcoM1Y4g
vF4obx/65Gd9DpJVFvK4IdLv6Qk2ZXZh5XWSrYKalpzDRTUuMZ372qxugcJufLg9
2K6UUb6lzxic0WAK0lYbPaHCQP7BuurR6tnXtqHFrLIb5QIdthOAoveZJofzDR4I
idRLGSxX/6GP1z2PmE2pvEQ1Z3IlFjVKJuFkmux0NVji+87HsTN5a5lKf7Igmxsc
pQGdA83tjTVNliBd3RwPc+dT3099Udh7GiBCjR9p/l7iz86Nf1XDFU29B+o34trd
QnDVQcvpM/DD7vtyuG1vCBQMLGzyDcIS+xA0YcVGRoHaOL7QP4OQfwLgAKxrIdzf
eXvUYem0J8yP43HYQJV9YydV3vJ1wrchXRb+Yj6dYSDpQAIHCg68b8gT4xxTyatz
pXaiMAkup6rNWlNdO3jhDlS/3lKf5AK0K1Dy9ld9pZ9wdI9QKMGMMChzxRbFbCHE
/jpqpPjQFN12exEw5qrUPYBBBgBSBuK1L/jV42Yx0XJq62Rf6D5QdAdMudMcK93Q
bV5Ko3nPYA8O4xoK03Ka+k7e1yQvWk+cdE/8Z1A1yspMAzhkjEAkSqzUZXD1udHa
VpMPraBQ/QU8vAU50YClY4agMvsdlTzZLkJKiRfWYdR21VsQZdU=
=yYcK
-----END PGP SIGNATURE-----