devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Ayush Singh <ayush@beagleboard.org>
Cc: d-gole@ti.com, lorforlinux@beagleboard.org,
	jkridner@beagleboard.org, robertcnelson@beagleboard.org,
	nenad.marinkovic@mikroe.com, Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Robert Nelson <robertcnelson@gmail.com>,
	devicetree-compiler@vger.kernel.org
Subject: Re: [PATCH 1/2] libfdt: overlay: Allow resolving phandle symbols
Date: Thu, 12 Sep 2024 13:38:45 +1000	[thread overview]
Message-ID: <ZuJiRfTWm8f8YfZ7@zatzit.fritz.box> (raw)
In-Reply-To: <3f062731-5819-4fb3-bf97-5748be63eb17@beagleboard.org>

[-- Attachment #1: Type: text/plain, Size: 2623 bytes --]

On Mon, Sep 09, 2024 at 12:54:34PM +0530, Ayush Singh wrote:
> On 9/9/24 10:33, David Gibson wrote:
> 
> > On Mon, Sep 02, 2024 at 05:47:55PM +0530, Ayush Singh wrote:
> > > Add ability to resolve symbols pointing to phandles instead of strings.
> > > 
> > > Combining this with existing fixups infrastructure allows creating
> > > symbols in overlays that refer to undefined phandles. This is planned to
> > > be used for addon board chaining [1].
> > I don't think this "autodetection" of whether the value is a phandle
> > or path is a good idea.  Yes, it's probably unlikely to get it wrong
> > in practice, but sloppy cases like this have a habit of coming back to
> > bite you later on.  If you want this, I think you need to design a new
> > way of encoding the new options.
> 
> Would something like `__symbols_phandle__` work?

Preferable to the overloaded values in the original version, certainly.

> It should be fairly
> straightforward to do. I am not sure how old devicetree compilers will react
> to it though?

Well, the devicetree compiler itself never actually looks at the
overlay encoding stuff.  The relevant thing is libfdt's overlay
application logic... and any other implementations of overlay handling
that are out there.

At which I should probably emphasize that changes to the overlay
format aren't really mine to approve or not.  It's more or less an
open standard, although not one with a particularly formal definition.
Of course, libfdt's implementation - and therefore I - do have a fair
bit of influence on what's considered the standard.

> I really do not think having a different syntax for phandle symbols would be
> good since that would mean we will have 2 ways to represent phandles:
> 
> 1. For __symbols__
> 
> 2. For every other node.

I'm really not sure what you're getting at here.

> I also am not in the favor of doing something bespoke that does not play
> nice with the existing __fixups__ infra since that has already been
> thoroughly tested, and already creates __fixups__ for symbols.

Hmm.  Honestly, the (runtime) overlay format was pretty a hack that's
already trying to do rather more than it was really designed for.  I'm
a bit sceptical of any attempt to extend it further without
redesigning the whole thing with a bit more care and forethought.  I
believe Rob Herring has some thoughts along these lines too.

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-09-12  3:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 12:17 [PATCH 0/2] Add support for phandle in symbols Ayush Singh
2024-09-02 12:17 ` [PATCH 1/2] libfdt: overlay: Allow resolving phandle symbols Ayush Singh
2024-09-09  5:03   ` David Gibson
2024-09-09  7:24     ` Ayush Singh
2024-09-12  3:38       ` David Gibson [this message]
2024-09-16  9:40         ` Ayush Singh
2024-09-18  2:36           ` David Gibson
2024-09-20 16:34             ` Ayush Singh
2024-09-23  3:41               ` David Gibson
2024-09-23  8:22                 ` Geert Uytterhoeven
2024-09-23  8:38                   ` David Gibson
2024-09-23  9:12                     ` Geert Uytterhoeven
2024-09-23  9:48                       ` David Gibson
2024-11-13  9:46                         ` Ayush Singh
2024-10-06  5:13                       ` Ayush Singh
2024-09-24  6:41                 ` Ayush Singh
2024-09-25  7:28                   ` David Gibson
2024-09-25  7:58                     ` Geert Uytterhoeven
2024-09-26  3:51                       ` David Gibson
2024-10-03  7:35                     ` Ayush Singh
2024-09-02 12:17 ` [PATCH 2/2] tests: Add test for symbol resolution Ayush Singh
2024-09-05 14:37   ` Andrew Davis
2024-09-05 14:35 ` [PATCH 0/2] Add support for phandle in symbols Andrew Davis

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=ZuJiRfTWm8f8YfZ7@zatzit.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=afd@ti.com \
    --cc=ayush@beagleboard.org \
    --cc=d-gole@ti.com \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jkridner@beagleboard.org \
    --cc=lorforlinux@beagleboard.org \
    --cc=nenad.marinkovic@mikroe.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=robertcnelson@gmail.com \
    /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).