Devicetree
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	John Bonesio <bones-RkXMcIGFT/TR7s880joybQ@public.gmane.org>
Subject: Re: Proposal: new device-tree syntax and semantics for extending information from included dts files
Date: Tue, 19 Oct 2010 13:48:13 +1100	[thread overview]
Message-ID: <20101019024813.GE24726@yookeroo> (raw)
In-Reply-To: <AANLkTi=QaV5KvhFzyci2yykmsV9+Zz71vmoRrrFDGvK--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sat, Oct 16, 2010 at 12:57:21PM -0600, Grant Likely wrote:
> On Sat, Oct 16, 2010 at 1:02 AM, David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > On Wed, Oct 13, 2010 at 10:54:13PM -0600, Grant Likely wrote:
> >> On Thu, Oct 14, 2010 at 02:48:21PM +1100, David Gibson wrote:
> >> > On Wed, Oct 13, 2010 at 07:40:36PM -0600, Grant Likely wrote:
[snip]
> >> > We do already have ordering
> >> > amongst the top level items, since the last one wins.
> >>
> >> Right, but the ordering has been explicitly restricted to the top
> >> level trees using the "stack of overlays" conceptual model.
> >
> > Right, my point exactly.  I'm suggesting we keep it restricted to the
> > top level by only allowing these replace/remove operators (whatever
> > they look like) at the top level.
> 
> Sounds like we're having an impedance mismatch.  Let me try to

Yes, I noticed that :)

> clarify my position.  Ordering is still restricted to the top level
> what I'm suggesting.  For example, the following would be legal:

[snip]
> The model I'm suggesting is that each top level tree is fully
> constructed before being merged into the preceding tree.  Additional
> nodes and properties are easy to understand and it works already.
> I'm suggesting that the above illegal examples are exactly the same as
> the following illegal example:
> 
> 	/ {
> 		node {
> 			prop;
> 		};
> 		node {
> 			another-prop;
> 		};
> 	};
> 
> It is illegal because the node is defined twice in the same block.  If
> it were allowed, then it would raise the question of which node gets
> processed first, and we have explicitly decided not to support that
> model.
> 
> The removal or replacement of nodes is exactly the same.  However,
> instead of adding to a node, we set a flag in the new node stating
> that it replaces the node in the preceding tree.  Or in the case of
> removal, we set a flag that states the node in the preceding tree is
> to be removed without a replacement.
> 
> In terms of implementation this should be straight forward.  In the
> merge_nodes function, check the new node for a replace/remove flag,
> and if it is set then remove/replace the old node instead of merging
> with the new.  This can probably be performed in the
> while(new_node->children) loop.

> This is what I was talking about when I mentioned using a flag
> earlier.  The /*-node/ keyword could set a flag in the node structure
> so that merge_nodes handles the operation correctly when merging the
> trees.

Right, I understand the model and, yes, it's simple enough to
implement.  I'm just not sure if it's a good idea - allowing the
replace versus extend flag to be per sub-tree rather than per toplevel
tree is a step up in model complexity, and hence a step down in
obviousness.  I'm not yet sure if it's worth it (or perhaps rather, if
there's a cleaner alternative).

> >> > Now, if using
> >> > labels rather than full paths it does get a bit curlier on the
> >> > implementation side.  But I don't think it would be that hard to make
> >> > labels stick around attached to a path, even when the path itself is
> >> > removed.
> >>
> >> Ah right, the issue here was that a previous tree could be holding a
> >> label reference that gets deleted in an overlay.  And there are
> >> questions about what happens if a label is removed and then the same
> >> label attached to a new node, specifically because labels aren't
> >> resolved until after the trees are fully parsed.  (let me know if I'm
> >> remembering incorrectly).  I think this is solvable though, but we're
> >> going to need to define the semantics.
> >>
> >> I need to review the details though.  I can't remember all the ways
> >> that the code handles label resolution.
> >
> > Right.  Having labels move around seriously muddies the waters, since
> > the whole idea of labels is to unambiguously refer to a node.  I think
> > the sanest thing is to prohibit duplicate labels, even if the labelled
> > nodes have been removed between the duplicate declarations.  In the
> > later stages of processing, then, referring to a deleted label would
> > be detectable and trigger an error at that point.
> 
> Fair enough.  I can agree to that constraint.  It can be revisited
> again if it is too restrictive, and it is easier to relax
> restrictions later than it is to add new restrictions at a later date.

Ok.

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

      parent reply	other threads:[~2010-10-19  2:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1286920561.4535.1315.camel@riker>
2010-10-13 23:17 ` Proposal: new device-tree syntax and semantics for extending information from included dts files Grant Likely
     [not found]   ` <20101013231747.GD15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-13 23:41     ` Proposal: new device-tree syntax and semantics for extendinginformation " Stephen Neuendorffer
     [not found]       ` <d223e561-ed6e-44c2-8a99-8959e85ae022-+Ck8Kgl/v0/nHLUNXTEFU7jjLBE8jN/0@public.gmane.org>
2010-10-14  0:45         ` David Gibson
2010-10-14  1:46           ` Grant Likely
     [not found]             ` <20101014014657.GF15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-14  3:31               ` David Gibson
2010-10-14 16:38           ` Stephen Neuendorffer
     [not found]             ` <21eeaef0-fc78-47c9-b1c5-bfefaa55fb85-RaUQJvECHis6W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-10-15 15:18               ` Grant Likely
     [not found]                 ` <20101015151840.GB32705-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-15 16:10                   ` Stephen Neuendorffer
     [not found]                     ` <b04d95cc-c35b-4597-8fbe-f7c48f23ef92-+Ck8Kgl/v09DUMyIFHz4objjLBE8jN/0@public.gmane.org>
2010-10-15 19:32                       ` Grant Likely
     [not found]                         ` <AANLkTinPWv94Xoz+mDxiE=KujQYAyQj9PsPWHEORypJ3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 19:48                           ` Stephen Neuendorffer
     [not found]                             ` <eba820f8-3e4f-4d57-9024-39cc562a99eb-+Ck8Kgl/v0/0H8R8xLlBI7jjLBE8jN/0@public.gmane.org>
2010-10-15 19:56                               ` Grant Likely
     [not found]                                 ` <AANLkTikWfMXEbdwFY6FNoMwuD6fC74Kohtr3QRJqSrM0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 19:59                                   ` Stephen Neuendorffer
     [not found]                                     ` <ed27a45d-3607-41e3-831f-1d7e3dd44379-RaUQJvECHis6W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-10-15 20:11                                       ` Grant Likely
     [not found]                                         ` <AANLkTikzyDFiQZzPmeos6pf_DS33RvkfER+Mz0jceSJy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 20:20                                           ` Stephen Neuendorffer
     [not found]                                             ` <4da0557a-d204-4e38-8a82-b0996a9a5af1-RaUQJvECHitCYczPSvLbDrjjLBE8jN/0@public.gmane.org>
2010-10-15 23:58                                               ` Grant Likely
     [not found]                                                 ` <AANLkTinzf3vhs_OUUeiVYOFbOPLFHA+dei810H2gyDGS-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-16  7:10                                                   ` David Gibson
2010-10-15 20:35                                           ` John Bonesio
2010-10-15 21:25                                             ` John Bonesio
2010-10-15 23:51                                             ` Grant Likely
2010-10-16  7:05                       ` David Gibson
2010-10-14  0:38     ` Proposal: new device-tree syntax and semantics for extending information " David Gibson
2010-10-14  1:40       ` Grant Likely
     [not found]         ` <20101014014036.GE15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-14  1:49           ` Grant Likely
2010-10-14  3:08           ` John Bonesio
2010-10-14  3:37             ` Grant Likely
2010-10-14  4:00             ` David Gibson
2010-10-14  3:48           ` David Gibson
2010-10-14  4:54             ` Grant Likely
     [not found]               ` <20101014045413.GK15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-16  7:02                 ` David Gibson
2010-10-16 18:57                   ` Grant Likely
     [not found]                     ` <AANLkTi=QaV5KvhFzyci2yykmsV9+Zz71vmoRrrFDGvK--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-16 19:50                       ` John Bonesio
2010-10-17  6:17                         ` Grant Likely
2010-10-19  2:48                       ` David Gibson [this message]

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=20101019024813.GE24726@yookeroo \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=bones-RkXMcIGFT/TR7s880joybQ@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@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