From: delicious quinoa <delicious.quinoa@gmail.com>
To: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <robherring2@gmail.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Matt Porter <matt.porter@linaro.org>,
Koen Kooi <koen@dominion.thruhere.net>,
Alison Chaiken <Alison_Chaiken@mentor.com>,
Dinh Nguyen <dinh.linux@gmail.com>, Jan Lubbe <jluebbe@lasnet.de>,
Alexander Sverdlin <alexander.sverdlin@nsn.com>,
Michael Stickel <ms@mycable.de>,
Guenter Roeck <linux@roeck-us.net>,
Dirk Behme <dirk.behme@gmail.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Michael Bohan <mbohan@codeaurora.org>,
Ionut Nicu <ioan.nicu.ext@nsn.com>,
Michal Simek <monstr@monstr.eu>,
Matt Ranostay <mranostay@gmail.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Pete Popov <pete.popov@konsulko.com>,
Dan Malek <dan.malek@konsulko.com>,
Georgi Vlaev <georgi.vlaev@konsulko.com>
Subject: Re: [PATCH v3 2/7] OF: Introduce DT overlay support.
Date: Fri, 28 Mar 2014 13:54:35 -0500 [thread overview]
Message-ID: <CANk1AXSUr03wqSFqB_cmPHS88GkmMB-ierAxmrc+v5hKFVT01g@mail.gmail.com> (raw)
In-Reply-To: <1395179766-31575-3-git-send-email-pantelis.antoniou@konsulko.com>
On Tue, Mar 18, 2014 at 4:56 PM, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> Introduce DT overlay support.
> Using this functionality it is possible to dynamically overlay a part of
> the kernel's tree with another tree that's been dynamically loaded.
> It is also possible to remove node and properties.
>
> The creation/destruction of the devices is handled by calling in to
> bus specific handlers which can deal with the peculiarities of each
> device.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
> Documentation/devicetree/overlay-notes.txt | 187 ++++++
> drivers/of/Kconfig | 10 +
> drivers/of/Makefile | 1 +
> drivers/of/overlay.c | 895 +++++++++++++++++++++++++++++
> include/linux/of.h | 153 +++++
> 5 files changed, 1246 insertions(+)
> create mode 100644 Documentation/devicetree/overlay-notes.txt
> create mode 100644 drivers/of/overlay.c
>
> diff --git a/Documentation/devicetree/overlay-notes.txt b/Documentation/devicetree/overlay-notes.txt
> new file mode 100644
> index 0000000..882d512
> --- /dev/null
> +++ b/Documentation/devicetree/overlay-notes.txt
> @@ -0,0 +1,187 @@
> +Device Tree Overlay Notes
> +-------------------------
> +
> +This document describes the implementation of the in-kernel
> +device tree overlay functionality residing in drivers/of/overlay.c and is a
> +companion document to Documentation/devicetree/dt-object-internal.txt[1] &
> +Documentation/devicetree/dynamic-resolution-notes.txt[2]
> +
> +How overlays work
> +-----------------
> +
> +A Device Tree's overlay purpose is to modify the kernel's live tree, and
> +have the modification affecting the state of the the kernel in a way that
> +is reflecting the changes.
> +Since the kernel mainly deals with devices, any new device node that result
> +in an active device should have it created while if the device node is either
> +disabled or removed all together, the affected device should be deregistered.
Suggestion for readability:
Since the kernel mainly deals with devices, any new device node that results
in an active device should have that device created. If the device node is
either disabled or removed altogether, the affected device should be
deregistered.
> +/**
> + * of_overlay - Apply @count overlays pointed at by @ovinfo_tab
> + * @count: Number of of_overlay_info's
> + * @ovinfo_tab: Array of overlay_info's to apply
> + *
> + * Applies the overlays given, while handling all error conditions
> + * appropriately. Either the operation succeeds, or if it fails the
> + * live tree is reverted to the state before the attempt.
> + * Returns 0, or an error if the overlay attempt failed.
> + */
> +int of_overlay(int count, struct of_overlay_info *ovinfo_tab);
Suggest renaming this function of_overlay_apply() for grep-ability
Alan Tull
aka
delicious quinoa
> +
> +/**
> + * of_overlay_revert - Revert a previously applied overlay
> + * @count: Number of of_overlay_info's
> + * @ovinfo_tab: Array of overlay_info's to apply
> + *
> + * Revert a previous overlay. The state of the live tree
> + * is reverted to the one before the overlay.
> + * Returns 0, or an error if the overlay table is not given.
> + */
> +int of_overlay_revert(int count, struct of_overlay_info *ovinfo_tab);
next prev parent reply other threads:[~2014-03-28 18:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 21:55 [PATCH v3 0/7] Introducing (yet again) Device Tree Overlays Pantelis Antoniou
2014-03-18 21:56 ` [PATCH v3 1/7] OF: Introduce Device Tree resolve support Pantelis Antoniou
2014-03-18 21:56 ` [PATCH v3 2/7] OF: Introduce DT overlay support Pantelis Antoniou
2014-03-28 14:51 ` delicious quinoa
2014-03-28 18:54 ` delicious quinoa [this message]
2014-03-18 21:56 ` [PATCH v3 3/7] OF: DT-Overlay configfs interface Pantelis Antoniou
[not found] ` <1395179766-31575-4-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-03-21 13:39 ` Rob Herring
[not found] ` <CAL_JsqKJqakXGWDEKPAoJ9P5myYXnodcYCdvowV6MPuZXgwVmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-21 13:56 ` Sebastian Hesselbarth
2014-03-18 21:56 ` [PATCH v3 4/7] OF: platform: Add overlay bus handler Pantelis Antoniou
[not found] ` <1395179766-31575-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-03-18 21:56 ` [PATCH v3 5/7] OF: i2c: " Pantelis Antoniou
2014-03-18 21:56 ` [PATCH v3 6/7] OF: spi: " Pantelis Antoniou
[not found] ` <1395179766-31575-7-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-03-20 10:51 ` Michael Stickel
2014-03-18 21:56 ` [PATCH v3 7/7] of: i2c: Export single device registration method Pantelis Antoniou
2014-03-28 18:27 ` [PATCH v3 0/7] Introducing (yet again) Device Tree Overlays delicious quinoa
[not found] ` <CANk1AXTb=ob52AfK2z--HvFkxJnjnfYWuTCch_Gw99OCoS1ABg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03 20:40 ` delicious quinoa
2014-04-16 21:23 ` delicious quinoa
[not found] ` <CANk1AXT7bPeus3WFPJ3mVHZ+HSuJ5DabxKQ7df1TV2A8-82-OQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-16 21:33 ` Rob Herring
[not found] ` <CAL_JsqKHY_osEhE6HefV_PT+bXmv1vBWvCOY_93Sju0pbULoqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-17 15:46 ` delicious quinoa
2014-04-17 16:12 ` Pantelis Antoniou
[not found] ` <7706B5FF-45EB-4860-BD12-204B341A510D-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-04-18 16:54 ` delicious quinoa
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=CANk1AXSUr03wqSFqB_cmPHS88GkmMB-ierAxmrc+v5hKFVT01g@mail.gmail.com \
--to=delicious.quinoa@gmail.com \
--cc=Alison_Chaiken@mentor.com \
--cc=alexander.sverdlin@nsn.com \
--cc=dan.malek@konsulko.com \
--cc=devicetree@vger.kernel.org \
--cc=dinh.linux@gmail.com \
--cc=dirk.behme@gmail.com \
--cc=georgi.vlaev@konsulko.com \
--cc=grant.likely@secretlab.ca \
--cc=ioan.nicu.ext@nsn.com \
--cc=jluebbe@lasnet.de \
--cc=koen@dominion.thruhere.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=matt.porter@linaro.org \
--cc=mbohan@codeaurora.org \
--cc=monstr@monstr.eu \
--cc=mranostay@gmail.com \
--cc=ms@mycable.de \
--cc=pantelis.antoniou@konsulko.com \
--cc=pete.popov@konsulko.com \
--cc=robherring2@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=swarren@wwwdotorg.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).