All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russ Dill <Russ.Dill@ti.com>
To: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Rob Herring <robherring2@gmail.com>,
	Deepak Saxena <dsaxena@linaro.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Scott Wood <scottwood@freescale.com>,
	Tony Lindgren <tony@atomide.com>, Kevin Hilman <khilman@ti.com>,
	Matt Porter <mporter@ti.com>,
	Koen Kooi <koen@dominion.thruhere.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Felipe Balbi <balbi@ti.com>,
	linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2)
Date: Mon, 12 Nov 2012 12:16:23 -0800	[thread overview]
Message-ID: <CA+Bv8XZV_RXQ351QG6ztvX=aTQubFHOR2Hgtc+ZSLKRo4_MNsQ@mail.gmail.com> (raw)
In-Reply-To: <C3971D11-2BAC-4B58-AF8D-987FF8FFF678@antoniou-consulting.com>

On Mon, Nov 12, 2012 at 3:23 AM, Pantelis Antoniou
<panto@antoniou-consulting.com> wrote:
> Hi Grant,
>
> Sorry for the late comments, travelling...
>
> On Nov 9, 2012, at 6:28 PM, Grant Likely wrote:
>
>> On Tue, Nov 6, 2012 at 10:37 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> On 11/05/2012 01:40 PM, Grant Likely wrote:
>>>> Hey folks,
>>>>
>>>> As promised, here is my early draft to try and capture what device
>>>> tree overlays need to do and how to get there. Comments and
>>>> suggestions greatly appreciated.
>>>
>>> Interesting. This just came up internally at NVIDIA within the last
>>> couple weeks, and was discussed on the U-Boot mailing list very recently
>>> too:
>>>
>>> http://lists.denx.de/pipermail/u-boot/2012-October/thread.html#138227
>>> (it spills into the November archive too)
>>>
>>>> For these cases it is proposed to implement an overlay feature for the
>>>> so that the initial device tree data can be modified by userspace at
>>>
>>> I don't know if you're maintaining this as a document and taking patches
>>> to it, but if so:
>>
>> Sure, why not...
>>
>> http://git.secretlab.ca/?p=devicetree-overlays.git;a=summary
>>
>>>
>>> "for the so" split across those two lines.
>>
>> fixed
>>
>>>>  - SHOULD reliably handle changes between different underlying overlays
>>>>    (ie. what happens to existing .dtb overly files if the structure of
>>>>    the dtb it is layered over changes. If not possible, then SHALL
>>>>    detect when the base tree doesn't match and refuse to apply the
>>>>    overlay.
>>>
>>> Perhaps use (versioned) DT bindings to represent the interface between
>>> the two .dts files? See the links to the U-Boot mailing list discussions
>>> below?
>>
>> Implementing versioning is conceptually a lot more complex than plain
>> overlays since it means either the kernel or u-boot needs to start
>> filtering the data that it's given. This can get really complex in a
>> hurry. Mitch makes a valid point later in this thread that when it
>> comes to manipulating the data depending on the board then the data
>> overlay model alone doesn't handle it well.
>>
>> I'm not actually opposed to it, but it needs to be done in an elegant
>> way. The DT data model already imposes more of a conceptual learning
>> curve than I wish it did and I don't want to make that worse with a
>> versioning model that is difficult to get ones head around.
>>
>> Suggestions and proposals are definitely welcome here.
>>
>
> I didn't find versioning all that difficult TBH.
>
> Making the property access functions work sanely with versioning
> should cover most (if not all) kernel users.
> Keep non versioned property access function available to possibly
> users with a prefix for those that need it.
>
>>>
>>>> - What is the model for overlays?
>>>>  - Can an overlay modify existing properties?
>>>>  - Can an overlay add new properties to existing nodes?
>>>>  - Can an overlay delete existing nodes/properties?
>>>
>>> This proposal is very oriented at an overlay-based approach. I'm not
>>> totally convinced that a pure overlay approach (as in how dtc does
>>> overlayed DT nodes) will be flexible enough, but would love to be
>>> persuaded. Again see below.
>>
>> The way I'm currently thinking about the overlay approach is as a
>> discrete set of changes that all can be applied at once.* That
>> certainly doesn't preclude the change being generated with a script or
>> other tool in either firmware or userspace. For most changes it works
>> really well. Of the scenarios that don't work well, I can think of
>> two. The first is it moving or renaming existing nodes, and the second
>> is if the structure of the base tree changes (say due to a firmware
>> update). Although the second limitation is specifically with binary
>> .dtb overlays. Recompiling the dts overlay against the new tree would
>> work fine.**
>>
>
> Atomicity should be handled correctly. I can't imagine how hard would
> be to back out a semi-applied overlay without some kind of core DT
> tracking support. Leaving it to the driver/user is too difficult to get
> right.
>
> About moving and renaming nodes, I can't think of a user-case today that
> needs it. Perhaps it can be handled by removal & re-insertion?
>
>> *with the caveat that not all types of changes are a good idea and we
>> may disallow. For example, is changing properties in existing nodes a
>> good idea?
>
> Yes, changing properties is something that we need. One such change is
> the change of the bus controller 'status' properties to enabled upon
> insertion of a child device node, and change back to 'on-demand' when
> all the child device nodes are gone.

Some devices will probably have to support on the fly changes that
they may not have otherwise supported. An example of a driver that
needs to modify it's device based on DT would be an I²C bus speed
change.

  parent reply	other threads:[~2012-11-12 20:16 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 20:40 [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2) Grant Likely
2012-11-05 21:40 ` Tabi Timur-B04825
2012-11-05 21:40   ` Tabi Timur-B04825
2012-11-05 23:22   ` Tony Lindgren
2012-11-05 23:22     ` Tony Lindgren
2012-11-09 12:06     ` Grant Likely
2012-11-09 12:06       ` Grant Likely
2012-11-06  0:07   ` Grant Likely
2012-11-06  0:07     ` Grant Likely
2012-11-06 10:31   ` Pantelis Antoniou
2012-11-06 10:31     ` Pantelis Antoniou
2012-11-07 22:35   ` Ryan Mallon
2012-11-07 22:35     ` Ryan Mallon
2012-11-08 13:28     ` Koen Kooi
2012-11-08 13:28       ` Koen Kooi
2012-11-08 14:09       ` Timur Tabi
2012-11-08 14:09         ` Timur Tabi
2012-11-08 17:00       ` Mitch Bradley
2012-11-08 17:00         ` Mitch Bradley
2012-11-06 10:30 ` Pantelis Antoniou
2012-11-06 11:14   ` Grant Likely
2012-11-06 18:35     ` Tony Lindgren
2012-11-06 19:29       ` Russ Dill
2012-11-06 19:41         ` Pantelis Antoniou
2012-11-06 19:41           ` Pantelis Antoniou
2012-11-06 22:17           ` Stephen Warren
2012-11-06 22:17             ` Stephen Warren
2012-11-06 19:34     ` Pantelis Antoniou
2012-11-06 20:45       ` Grant Likely
2012-11-06 20:50         ` Grant Likely
2012-11-07  8:06         ` Pantelis Antoniou
2012-11-07 15:33           ` Alan Tull
2012-11-07 15:33             ` Alan Tull
2012-11-09 17:03           ` Grant Likely
2012-11-07  8:13         ` Pantelis Antoniou
2012-11-07 10:19           ` Benoit Cousson
2012-11-07 10:19             ` Benoit Cousson
2012-11-07 11:02             ` Pantelis Antoniou
2012-11-07 11:02               ` Pantelis Antoniou
2012-11-07 11:12               ` Benoit Cousson
2012-11-07 11:12                 ` Benoit Cousson
2012-11-07 11:23                 ` Pantelis Antoniou
2012-11-07 11:23                   ` Pantelis Antoniou
2012-11-09 20:33               ` Grant Likely
2012-11-12 11:34                 ` Pantelis Antoniou
2012-11-12 13:01                   ` Grant Likely
2012-11-07 17:25             ` Stephen Warren
2012-11-07 22:10               ` Pantelis Antoniou
2012-11-07 22:10                 ` Pantelis Antoniou
2012-11-08 10:36               ` Cousson, Benoit
2012-11-08 10:36                 ` Cousson, Benoit
2012-11-09  5:32   ` Joel A Fernandes
2012-11-09 14:29     ` David Gibson
2012-11-10  3:15       ` Joel A Fernandes
2012-11-09 21:22     ` Grant Likely
2012-11-12 11:47       ` Pantelis Antoniou
2012-11-12 11:47         ` Pantelis Antoniou
2012-11-13  3:59       ` Joel A Fernandes
2012-11-09 22:59     ` Stephen Warren
     [not found]   ` <-4237940489086529028@unknownmsgid>
     [not found]     ` <559B8433-67C3-4A1A-A5D6-859907655176@antoniou-consulting.com>
2012-11-10  3:36       ` Joel A Fernandes
2012-11-10  3:36         ` Joel A Fernandes
2012-11-12 12:48         ` Pantelis Antoniou
2012-11-13  2:28         ` David Gibson
2012-11-06 22:37 ` Stephen Warren
2012-11-06 22:37   ` Stephen Warren
2012-11-07  0:54   ` Mitch Bradley
2012-11-07  0:54     ` Mitch Bradley
2012-11-09 17:02     ` Grant Likely
2012-11-12 11:29       ` Pantelis Antoniou
2012-11-07  8:47   ` Pantelis Antoniou
2012-11-07 17:18     ` Stephen Warren
2012-11-07 22:08       ` Pantelis Antoniou
2012-11-07 22:08         ` Pantelis Antoniou
2012-11-09 16:28   ` Grant Likely
2012-11-09 23:23     ` Stephen Warren
2012-11-09 23:40       ` Grant Likely
2012-11-12 10:53         ` Koen Kooi
2012-11-12 12:10       ` Pantelis Antoniou
2012-11-12 12:10         ` Pantelis Antoniou
2012-11-12 16:52         ` Stephen Warren
2012-11-13  7:25           ` David Gibson
2012-11-13  8:09             ` Pantelis Antoniou
2012-11-13  8:09               ` Pantelis Antoniou
2012-11-13 12:24               ` Grant Likely
2012-11-13 13:38                 ` Pantelis Antoniou
2012-11-13 13:38                   ` Pantelis Antoniou
2012-11-15  4:57                   ` David Gibson
2012-11-13 17:10               ` Stephen Warren
2012-11-13 23:30               ` David Gibson
2012-11-13 23:30                 ` David Gibson
2012-11-14  0:00                 ` Pantelis Antoniou
2012-11-13 16:57             ` Stephen Warren
2012-11-13 18:10               ` Mitch Bradley
2012-11-13 18:10                 ` Mitch Bradley
2012-11-13 18:29                 ` Stephen Warren
2012-11-13 18:29                   ` Stephen Warren
2012-11-13 19:09                   ` Mitch Bradley
2012-11-13 19:11                     ` Pantelis Antoniou
2012-11-17 22:27       ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-20 17:09         ` Grant Likely
2012-11-11 20:47     ` Rob Landley
2012-11-12 12:50       ` Pantelis Antoniou
2012-11-12 16:54         ` Stephen Warren
2012-11-12 16:54           ` Stephen Warren
2012-11-12 11:23     ` Pantelis Antoniou
2012-11-12 16:49       ` Stephen Warren
2012-11-12 17:00         ` Pantelis Antoniou
2012-11-12 17:10           ` Stephen Warren
2012-11-12 17:19             ` Pantelis Antoniou
2012-11-12 17:29               ` Stephen Warren
2012-11-12 17:38                 ` Pantelis Antoniou
2012-11-12 20:16       ` Russ Dill [this message]
2012-11-12 16:45     ` Stephen Warren
2012-11-09  2:26 ` David Gibson
2012-11-09 15:40   ` Pantelis Antoniou
2012-11-13  0:03     ` David Gibson
2012-11-13  0:03       ` David Gibson
2012-11-09 21:08   ` Grant Likely
2012-11-13  0:05     ` David Gibson
2012-11-13  0:05       ` David Gibson
2012-11-09 21:42   ` Grant Likely
2012-11-13  1:05     ` David Gibson
2012-11-13  1:05       ` David Gibson
2012-11-13  5:22       ` Stephen Warren
2012-11-13  6:54         ` David Gibson
2012-11-13  6:54           ` David Gibson
2012-11-09 22:57   ` Stephen Warren
2012-11-09 23:27     ` Grant Likely
2012-11-12 12:05     ` Pantelis Antoniou
2012-11-09 23:14   ` Stephen Warren
2012-11-09 23:14     ` Stephen Warren
2012-11-09 23:06 ` Stephen Warren
2012-11-09 23:32   ` Grant Likely
2012-11-12 11:03 ` Koen Kooi
2012-11-12 11:03   ` Koen Kooi

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='CA+Bv8XZV_RXQ351QG6ztvX=aTQubFHOR2Hgtc+ZSLKRo4_MNsQ@mail.gmail.com' \
    --to=russ.dill@ti.com \
    --cc=balbi@ti.com \
    --cc=benh@kernel.crashing.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dsaxena@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=khilman@ti.com \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mporter@ti.com \
    --cc=panto@antoniou-consulting.com \
    --cc=robherring2@gmail.com \
    --cc=scottwood@freescale.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.