archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <>
To: Rob Herring <>
Cc: "David Gibson"
	"Devicetree Compiler"
	"Jon Loeliger" <jdl-CYoMK+44s/>,
	"Pantelis Antoniou"
	"Grant Likely"
	"Marek Vašut"
	"Tom Rini" <trini-OWPKS81ov/FWk0Htik3J/>,
	"Kyle Evans" <>,
	"Geert Uytterhoeven"
	"Alan Tull" <>,
	"Michael Ellerman" <mpe-Gsx/>
Subject: Re: [RFC] devicetree: new FDT format version
Date: Thu, 25 Jan 2018 15:11:32 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 01/24/18 13:16, Frank Rowand wrote:
> On 01/24/18 07:47, Rob Herring wrote:
>> On Tue, Jan 23, 2018 at 3:17 PM, Frank Rowand <> wrote:
>>> On 01/23/18 04:42, David Gibson wrote:
>>>> On Mon, Jan 22, 2018 at 03:01:52PM -0600, Rob Herring wrote:
>>>>> On Mon, Jan 22, 2018 at 2:09 AM, Frank Rowand <> wrote:

< snip >

>>> My first shot at the new format added a field to the FDT to indicate
>>> that an overlay FDT was concatenated to the FDT (and the overlay FDT
>>> in turn could set it's field to concatenate another overlay FDT).

< snip >

>>> For ease of typing, I'll call this "chaining" or "chained".  For
>>> Linux, I am envisioning no kernel use of data from a chained FDT
>>> until after the tree is unflattened.  I haven't done an exhaustive
>>> search to determine all of the uses of data directly from the
>>> flattened FDT, but I am optimistic that there will not be any such
>>> access that would require data from a chained FDT (and we could
>>> make this a rule).
>> This would be a major downside to leaving it up to the kernel because
>> what can't be touched is hard to enumerate and could change. For
>> example, we added earlycon and now the uart node can't be modified.
> What you say makes sense.  So I'll reverse myself and say that for
> Linux, we should update the FDT read code to scan all chained
> overlay FDT(s) as well as the base FDT.

< snip >

And I'll reverse myself again, so full circle.

As David pointed out elsewhere, targeting overlay fragments to
their actual position in the tree makes a function that scans
the chained FDTs for a property value (as an example) very
complex.  Given that insight, I agreed with David.

With that further background, I'm back here to reconsider
devicetree data that is accessed by the kernel early in
boot, before the devicetree is unflattened.

The early boot time frame can be a difficult environment to
code within.  There are a lot of limitations to what features
and services are available.  We try to limit the amount of
code in this window to as little as possible.  Given that,
is it reasonable to assume that we won't be adding a lot
of code that accesses the devicetree before it is unflattened?
I wouldn't say zero code, but I would hope very little code.

*** I'm thinking out loud as I'm typing this, and it turns
*** out that this following paragraph is not workable,
*** so after this paragraph, I'll reject it.  So don't
*** take this paragraph as a serious proposal.
If that premise is accepted, and if we added _either_ a
specification restriction on overlays _or_ a warning or
"don't come crying to us if you need to modify your
existing base FDT and/or overlay FDT to take advantage
of a _new_ early boot feature", how does that change things?
The restriction would be something like (could take a
different form that accomplishes the same goal): the base
FDT must contain all data that is used by pre-unflatten
code and overlay FDTs must not modify that data.

And now I've wrapped myself info a tight little ball
that will not work, because detecting (and preventing)
an overlay from modifying this data is an unreasonable
amount of complexity.  The best that I could do would
be to say:  all data that is used by pre-unflatten
code must be contained in the base FDT, if an overlay
FDT modifies any of this data, the pre-unflatten
feature has the option of ignoring the changes, or
at some point after unflattening, re-reading the data
from the expanded tree.  That leaves a bad taste in
my mouth, I don't like it.  But it is a possible

Another option would be to remove as much of the
pre-unflatten data access as possible, moving the
accesses to just after unflattening and accept
that some features just won't be available until
after unflattening.  Can we reduce this set of
data to data that is not modifiable by an overlay
(such as mem_rsvmap) or is that too constricting?

I'll continue to ponder this area...


  parent reply	other threads:[~2018-01-25 23:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  8:09 Frank Rowand
     [not found] ` <>
2018-01-22  8:14   ` Frank Rowand
     [not found]     ` <>
2018-01-22 20:08       ` Frank Rowand
2018-01-22 20:08   ` Frank Rowand
     [not found]     ` <>
2018-01-25  0:27       ` Frank Rowand
     [not found]         ` <>
2018-01-27  8:48           ` David Gibson
2018-01-29  8:08             ` Frank Rowand
     [not found]               ` <>
2018-01-29 10:56                 ` David Gibson
2018-01-30  1:29                   ` Frank Rowand
2018-01-22 21:01   ` Rob Herring
     [not found]     ` <>
2018-01-23 12:42       ` David Gibson
2018-01-23 21:17         ` Frank Rowand
     [not found]           ` <>
2018-01-24 15:47             ` Rob Herring
     [not found]               ` <>
2018-01-24 21:16                 ` Frank Rowand
     [not found]                   ` <>
2018-01-24 22:27                     ` Alan Tull
2018-01-25  0:22                     ` Frank Rowand
     [not found]                       ` <>
2018-01-25 12:29                         ` David Gibson
2018-01-25 20:01                           ` Frank Rowand
     [not found]                             ` <>
2018-01-29 18:32                               ` Grant Likely
     [not found]                                 ` <>
2018-01-29 23:15                                   ` David Gibson
2018-01-26  8:56                           ` Geert Uytterhoeven
     [not found]                             ` <>
2018-01-26  8:59                               ` Geert Uytterhoeven
2018-01-26 22:08                               ` Frank Rowand
     [not found]                                 ` <>
2018-01-27  9:00                                   ` David Gibson
2018-01-27  8:56                               ` David Gibson
2018-01-25 23:11                     ` Frank Rowand [this message]
2018-01-25 12:22                 ` David Gibson
2018-01-25  9:14             ` Marek Vasut
     [not found]               ` <>
2018-01-25 12:37                 ` David Gibson
2018-01-27 20:30                   ` Marek Vasut
     [not found]                     ` <>
2018-01-29  0:53                       ` David Gibson
2018-01-23 12:05   ` David Gibson
2018-01-23 21:28     ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \
    --cc=grant.likely-s3s/ \
    --cc=jdl-CYoMK+44s/ \ \ \
    --cc=mpe-Gsx/ \
    --cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/ \
    --cc=panto-wVdstyuyKrO8r51toPun2/ \ \
    --cc=trini-OWPKS81ov/FWk0Htik3J/ \
    --subject='Re: [RFC] devicetree: new FDT format version' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox