devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyle Evans <kevans-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
To: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Cc: Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/2] overlays: auto allocate phandles for nodes in base fdt
Date: Tue, 16 Jan 2018 09:37:11 -0600	[thread overview]
Message-ID: <CACNAnaEeKKYWFY52X1hqUi+2ROPqCbKe+ccftF+o7uekRu8Aqw@mail.gmail.com> (raw)
In-Reply-To: <20180116133418.GL30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>

On Tue, Jan 16, 2018 at 7:34 AM, David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> On Fri, Jan 12, 2018 at 10:24:34AM -0600, Kyle Evans wrote:
>> On Fri, Jan 12, 2018 at 9:57 AM, Kyle Evans <kevans-h+KGxgPPiopAfugRpC6u6w@public.gmane.org> wrote:
>> > On Thu, Jan 11, 2018 at 11:33 PM, David Gibson
>> > <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
>> >> On Fri, Jan 05, 2018 at 12:40:13PM -0800, Frank Rowand wrote:
>> >>> On 01/04/18 21:47, Kyle Evans wrote:
>> >>> > On Thu, Jan 4, 2018 at 11:02 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >>> >> On 01/04/18 19:50, Kyle Evans wrote:
>> >>> >>> On Thu, Jan 4, 2018 at 9:14 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >>> >>>> On 01/04/18 18:39, Kyle Evans wrote:
>> >>> >>>>> On Thu, Jan 4, 2018 at 7:55 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >>> >>>>>> On 01/04/18 13:47, Kyle Evans wrote:
>> >>> >>>>>>> On Thu, Jan 4, 2018 at 3:34 PM, Kyle Evans <kevans-h+KGxgPPiopAfugRpC6u6w@public.gmane.org> wrote:
>> >>> >>>>>>>> On Thu, Jan 4, 2018 at 2:41 PM, Kyle Evans <kevans-h+KGxgPPiopAfugRpC6u6w@public.gmane.org> wrote:
>> >>> >>>>>>>>> On Thu, Jan 4, 2018 at 2:33 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >>> >>>>>>>>>> [... snip ...]
>> >> [snip]
>> >>> > Your implementation knows what my overlay means otherwise because I
>> >>> > reference a labelled node using &foo, dtc generated a /__fixup__ for
>> >>> > it, your implementation takes that /__fixup__ and does the lookup in
>> >>> > the symbol table. The symbol exists and points to a node, what's the
>> >>> > point of rejecting it there?>
>> >>> > It seems unreasonable to me, because you cannot always control the
>> >>> > source of your live tree. In many cases, sure, it's generated in-tree
>> >>> > or in U-Boot and passed to you, and you can reasonably expect you
>> >>> > won't encounter this. What if you have vendor-provided tree?
>> >>> >
>> >>> > I think the point I'm getting at is that it seems like this will have
>> >>> > to change at some point anyways simply because you can't control all
>> >>> > sources of your devicetree, and this isn't strictly wrong. Telling
>> >>> > someone "No, we can't apply that overlay because your vendor's
>> >>> > internal tool for generating dts and $other_format_used_internally
>> >>> > simultaneously didn't generate a phandle for that" is kind of hard,> especially when your reasoning ISN'T "their blob is malformed" or
>> >>> > "your overlay's reference is ambiguous" but rather, "we know what
>> >>> > that's pointing at, but we just don't generate handles."
>> >>>
>> >>> No, the blob _is_ malformed.  I know there is no official binding
>> >>> document for overlays (we do need such things once we figure out
>> >>> what we are doing), so this comment is purely my opinion.
>> >>
>> >> In this case it's not a spec for overlays that's the issue, it's a
>> >> spec for what base trees require in order to accept overlays.
>> >>
>> >>> The blob is malformed because it was not compiled with the "-@"
>> >>> flag.  Mostly not because of anything in the source, although
>> >>> again the __symbols__ node should not be hand coded.
>> >>
>> >> I don't think it's reasonable to claim a blob is malformed based
>> >> purely on how it was generated, it needs to be something about it's
>> >> actualy contents.
>> >>
>> >> So the question is: is "includes a phandle for every node with a
>> >> symbol" a requirement for an overlay accepting base tree.  It's never
>> >> been explicitly stated, since overlays were just kind of hacked
>> >> together rather than fully specced out.  dtc has been written assuming
>> >> that is a requirement, BSDdtc has not.
>> >>
>> >> I'm inclined to say "yes, it should be a requirement" on the grounds
>> >> that:
>> >>     a) that's the interpretation that's more widely deployed already
>> >> and
>> >>     b) that simplifies the overlay application logic, which generally
>> >>        takes place in a more restricted environment than the initial
>> >>        compilation.
>> >>
>> >> I'm entirely open to arguments against that position though.
>> >
>> > To be honest, I think both of these points are kind of wobbly. Just
>> > because something has been largely interpreted a certain way does not
>> > make it necessarily a good way to do so.
>> >
>> > It's also kind of hard to make the simplification point, my latest
>> > patch [1] that I run locally doesn't really touch existing stuff all
>> > that much, and it certainly doesn't feel any more complex than what
>> > was already there.
>> >
>> > I would be inclined to say that a spec shouldn't hold a strong
>> > position on this, for the following reasons:
>> >
>> > 1.) I've not yet seen a good technical reason for requiring explicit
>> > assignment. Explicit assignment was useful when you had no other
>> > method for resolving xrefs, but this isn't the case here.
>> >
>> > 2.) It's hard for a spec to say what the environmental restrictions
>> > will be of an implementation. While you might be memory-constrained, I
>> > might be disk-constrained. While you may not want to spend the extra
>> > cycles to walk the tree the first time to figure out the next phandle
>> > to be assigned, I might be OK with that trade-off.
>> >
>> > Ultimately, it should be up to the implementation actually applying
>> > these overlays to decide what it's willing to accept. I don't see that
>> > as a big problem, but I'm also coming from a stand-point that the only
>> > *blobs* I physically receive are those that I have no real control
>> > over because they come from firmware. No one that I know is physically
>> > passing blobs around to be used in u-boot or otherwise (save for
>> > rpi-firmware)... the transparency is crap and that's just silly.
>> >
>> > My suggested wording would likely be along the lines of "a base tree
>> > for accepting overlays should have a phandle assigned to every node
>> > that may be referenced in an overlay, but the mechanism for actually
>> > applying overlays may or may not require this."
>> >
>> > I like the 'should' wording, because it gives room to say "Look, if
>> > you're going to force a blob on people or expect these blobs to work
>> > on a wide range of systems, you should really do it this way for
>> > optimal compatibility" while also not restricting what I do as a
>> > consenting adult in the name of keeping things clean in an environment
>> > that I otherwise control.
>>
>> Sorry, I meant to add- this also gives you, Frank and co. room to say
>> "Sorry, this implementation doesn't accept this."
>
> I really don't want to do that.  There's already rather a lot of fuzz
> in DT and surrounding specs.  I don't want to add yet more room for
> incompatible implementations if we can avoid it.

Fair enough.

>> This allows one to
>> strip explicit phandles from things that their implementation does not
>> want xref'd and for the resulting blob to still be considered 'overlay
>> accepting' and accepted by implementations, because the
>> implementations have some choice in what they accept for base trees.
>>
>> Linux's loader implementation may accept willy-nilly for base trees,
>> while their live tree implementation will be a lot less accepting.
>> Sure, they also control the pipeline from loader to live tree, but for
>> demonstration purposes it's not that crazy to consider. Their live
>> tree implementation is still a valid implementation that applies
>> overlays to base trees, and I consider that fact significant to this
>> discussion.
>>
>> It gives me room to add an optional flag to our BSDL dtc to go back to
>> our former method of assigning phandles at compile-time, so that the
>> default for '-@' is the compatible behavior but a minimal approach may
>> be taken instead for those that choose to do so.
>
> I'm still not seeing why you're so keen on avoiding adding phandles.
> Doing so will already work with existing overlay implementations, and
> it's pretty much trivial to add, so why not just make the change to
> BSDdtc?

I've mentioned this a couple of times, I think, in e-mails you might
not have read yet- I have made the changes in BSDL dtc at least a
couple weeks ago to assign phandles to all labelled nodes. At this
point, it was about being flexible when possible rather than
unnecessarily rigid when it has no technical reason to be.

As I just saw your e-mail about not accepting it if it's behind an
#ifdef, this whole thing is moot.

  parent reply	other threads:[~2018-01-16 15:37 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 20:15 [PATCH v2 1/2] overlays: auto allocate phandles for nodes in base fdt Kyle Evans
     [not found] ` <CACNAnaEGfaZ=s5x8pw2AHf+SQHLTCTGCedL+TxOKXbA=e=kj0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04 20:33   ` Frank Rowand
     [not found]     ` <9711cac8-2501-7d68-2fb3-1c3a952fa96a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-04 20:41       ` Kyle Evans
     [not found]         ` <CACNAnaHck=vyC8dYa0HeFzd=MryucvOUSyYvkJw68tBe_goxWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04 21:34           ` Kyle Evans
     [not found]             ` <CACNAnaG=kcaUFFH7Dh70o1x-=1WxgJJGE1s0zsTdLvdYCcviMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04 21:47               ` Kyle Evans
     [not found]                 ` <CACNAnaHa=OuCrzVegg=7AemS8x=ADFsDs88WQ0phM+TLuYcZJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04 22:08                   ` Ian Lepore
     [not found]                     ` <1515103688.1759.29.camel-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-05  3:53                       ` David Gibson
     [not found]                         ` <20180105035317.GJ24581-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-05  4:23                           ` Kyle Evans
     [not found]                             ` <CACNAnaEXyhHcxCPz7MYmKS=uh-QdxUDZx7dSuY2=fpzLO44SWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 20:43                               ` Frank Rowand
2018-01-05  1:55                   ` Frank Rowand
     [not found]                     ` <fe1b36f1-9e38-0d32-6879-b9cd495afd12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-05  2:39                       ` Kyle Evans
     [not found]                         ` <CACNAnaFX6D8xqPFpgGGP6n7OzA29gB1pjFUpmmNM9roJgpPrdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05  3:14                           ` Frank Rowand
     [not found]                             ` <41a2006b-9b54-d803-7a28-457091db6f42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-05  3:50                               ` Kyle Evans
     [not found]                                 ` <CACNAnaGoZ+Ne6-d75q7bRokQ-Kr4iDr5kJAEXUybYvw2g2cbPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05  5:02                                   ` Frank Rowand
     [not found]                                     ` <5c11d86d-da33-ece5-3170-8fa0bbe5b546-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-05  5:47                                       ` Kyle Evans
     [not found]                                         ` <CACNAnaER1_EW0_HSWcViSiGPTqoLKkh-JF0UKLN1hAwzxhizvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 20:40                                           ` Frank Rowand
     [not found]                                             ` <79ae4708-6a55-a6b6-7eaf-e473baa2c1ac-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-05 21:04                                               ` Kyle Evans
     [not found]                                                 ` <CACNAnaFHQSPz4c_hLtGdn+9K6fz9iAZ+wL0Z+Tmz_7+=CJfkOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 21:22                                                   ` Frank Rowand
     [not found]                                                     ` <2a75a5f8-dba9-7ff2-4443-f1c2ffb374cc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-06  0:47                                                       ` Kyle Evans
     [not found]                                                         ` <CACNAnaFA7WHR1aDzX9qu=cbV48bDkdTDpR0x=bbARdOSmx7VOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-06  1:59                                                           ` Kyle Evans
     [not found]                                                             ` <CACNAnaE0AWtiTELCy07EVs2uGELU7Ber5cpg=O1TZjDsGdKPUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-16 14:07                                                               ` David Gibson
2018-01-16 14:05                                                           ` David Gibson
     [not found]                                                             ` <20180116140512.GO30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-16 15:24                                                               ` Kyle Evans
     [not found]                                                                 ` <CACNAnaEWNAXMFReZxQGJn2uyUvx_c0GuLWCo4h53bZOt7Fhvrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-16 23:38                                                                   ` David Gibson
2018-01-12  5:33                                               ` David Gibson
     [not found]                                                 ` <20180112053310.GL24770-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-12  7:07                                                   ` Frank Rowand
2018-01-12 15:57                                                   ` Kyle Evans
     [not found]                                                     ` <CACNAnaEWn4+hOREZ57-UNKRuypgght1C6_5oVkqhwmaj-1yGLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-12 16:24                                                       ` Kyle Evans
     [not found]                                                         ` <CACNAnaHL2q7kxNdete2L+ZNs7kDZY-g-Ly4bgYWfQsBy0R5KdA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-16 13:34                                                           ` David Gibson
     [not found]                                                             ` <20180116133418.GL30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-16 15:37                                                               ` Kyle Evans [this message]
2018-01-16 13:30                                                       ` David Gibson
     [not found]                                                         ` <20180116133040.GK30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-16 15:32                                                           ` Kyle Evans
     [not found]                                                             ` <CACNAnaFfXLVCG0e7KHtvU3rboKJpwMYV-WPqFw+kSMQeMqHu+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-16 23:40                                                               ` David Gibson
2018-01-10  9:44                                       ` David Gibson
     [not found]                                         ` <20180110094431.GC24770-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-10 14:15                                           ` Kyle Evans
2018-01-10  9:38                                   ` David Gibson
2018-01-10  9:19                           ` David Gibson
2018-01-05  3:40           ` David Gibson
     [not found]             ` <20180105034057.GH24581-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-05  4:00               ` Kyle Evans
  -- strict thread matches above, loose matches on Subject: below --
2018-01-01  6:59 [PATCHv2 0/2] " kevans-HZy0K5TPuP5AfugRpC6u6w
     [not found] ` <20180101065945.65451-1-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org>
2018-01-01  6:59   ` [PATCH v2 1/2] " kevans-HZy0K5TPuP5AfugRpC6u6w
     [not found]     ` <20180101065945.65451-2-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org>
2018-01-03  5:42       ` David Gibson
     [not found]         ` <20180103054220.GP24581-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-03 14:04           ` Kyle Evans
     [not found]             ` <CACNAnaHW19kCE24KUpi2LFNUS94H2xajq6WWpi0NgY53FAymzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04  3:26               ` David Gibson
     [not found]                 ` <20180104032600.GA24581-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-04 14:21                   ` Kyle Evans
     [not found]                     ` <CACNAnaHf6bQcJCkStCWy56cUYeXjZcO6TQfT2pCq=oBviDMckg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05  3:39                       ` David Gibson
2018-01-04 20:11       ` Frank Rowand

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=CACNAnaEeKKYWFY52X1hqUi+2ROPqCbKe+ccftF+o7uekRu8Aqw@mail.gmail.com \
    --to=kevans-h+kgxgppiopafugrpc6u6w@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.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;
as well as URLs for NNTP newsgroup(s).