devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Nathan Fontenot <nfont-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
Cc: Tyrel Datwyler
	<turtle.in.the.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Pantelis Antoniou
	<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
	Tyrel Datwyler
	<tyreld-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	linuxppc-dev
	<linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>
Subject: Re: OF_DYNAMIC node lifecycle
Date: Wed, 16 Jul 2014 18:44:09 -0600	[thread overview]
Message-ID: <CACxGe6vfOa3dMoE7BYt5YAJ39yA9b0A8SJMRZiXpCsvBfQ5dOQ@mail.gmail.com> (raw)
In-Reply-To: <53C706D2.7080207-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>

On Wed, Jul 16, 2014 at 5:12 PM, Nathan Fontenot <nfont-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org> wrote:
> On 07/16/2014 05:26 PM, Grant Likely wrote:
>> On Wed, Jul 16, 2014 at 2:57 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>> On Wed, Jul 16, 2014 at 12:30 PM, Tyrel Datwyler
>>> <turtle.in.the.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On 07/15/2014 10:33 PM, Grant Likely wrote:
>>>>> I've got another question about powerpc reconfiguration. I was looking
>>>>> at the dlpar_configure_connector() function in dlpar.c. I see that the
>>>>> function has the ability to process multiple nodes with additional
>>>>> sibling and child nodes. It appears to link them into a detached tree
>>>>> structure, and the function returns a pointer to the first node.
>>>>>
>>>>> All of the callers of that function then call dlpar_attach_node(),
>>>>> which calls of_attach_node(). However, of_attach_node() only handles a
>>>>> single node. It doesn't handle siblings or children. Is this a bug?
>>>>> Does the configure connector ever actually receive more than one node
>>>>> at once?
>>>>
>>>> Yes, it is sometimes the case we will get a tree structure back of more
>>>> than one node. Under the proc interface implementation this just worked.
>>>> With the move to sysfs it appears we have a regression here. What makes
>>>> more sense here, for us to walk the tree calling of_attach_node, or to
>>>> move such tree walking logic into of_attach_node? From what I can tell
>>>> we are the only consumers of of_attach_node.
>>>
>>> That is very shortly going to change. The overlay code also uses
>>> of_attach_node(). I can make of_attach_node() recurse over
>>> descendants, but I'm also considering moving the powerpc code over to
>>> the of_changeset series that Panto and I are working on.
>>>
>>> Either way, the handling of multiple nodes should be common code. I
>>> think the easiest is to put the recursion into of_attach_node(), at
>>> least for fixing the bug. It can be reworked later.
>>
>> On pseries, do notifiers ever fail? ie. Does the reconfig code ever
>> object to a DT change and prevent it from being applied?
>>
> I cannot think of a time that  I ever saw a notifier fail.

Good to know. I was hoping it wasn't part of the design. I can't think
of any situation where the kernel would want to inhibit a change to
the device tree.

Can you take a look at the following tree and give it a spin on
PowerPC. I've reordered the notifiers and hopefully got the powerpc
fixups right, but I don't have a way to test it...

The following changes since commit cd3de83f147601356395b57a8673e9c5ff1e59d1:

  Linux 3.16-rc4 (2014-07-06 12:37:51 -0700)

are available in the git repository at:

  git://git.secretlab.ca/git/linux devicetree/next-overlay

for you to fetch changes up to 44ac93bb5583c5f1f85912309fe04045b61a6dd0:

  of: Transactional DT support. (2014-07-16 16:44:07 -0600)

----------------------------------------------------------------
Grant Likely (6):
      of/platform: Fix of_platform_device_destroy iteration of devices
      of: Move CONFIG_OF_DYNAMIC code into a separate file
      of: Make sure attached nodes don't carry along extra children
      of: Move dynamic node fixups out of powerpc and into common code
      of: Make OF_DYNAMIC user selectable
      of: Reorder device tree changes and notifiers

Pantelis Antoniou (5):
      of: rename of_aliases_mutex to just of_mutex
      OF: Utility helper functions for dynamic nodes
      of: Create unlocked versions of node and property add/remove functions
      of: Make devicetree sysfs update functions consistent.
      of: Transactional DT support.

 Documentation/devicetree/changesets.txt         |  41 ++
 arch/powerpc/kernel/prom.c                      |  70 ---
 arch/powerpc/platforms/pseries/hotplug-memory.c |   2 +-
 drivers/crypto/nx/nx-842.c                      |  30 +-
 drivers/of/Kconfig                              |   2 +-
 drivers/of/Makefile                             |   1 +
 drivers/of/base.c                               | 423 ++++-----------
 drivers/of/device.c                             |   4 +-
 drivers/of/dynamic.c                            | 671 ++++++++++++++++++++++++
 drivers/of/of_private.h                         |  59 ++-
 drivers/of/platform.c                           |  32 +-
 drivers/of/selftest.c                           |  79 +++
 drivers/of/testcase-data/testcases.dtsi         |  10 +
 include/linux/of.h                              |  80 ++-
 include/linux/of_platform.h                     |   7 +-
 15 files changed, 1067 insertions(+), 444 deletions(-)
 create mode 100644 Documentation/devicetree/changesets.txt
 create mode 100644 drivers/of/dynamic.c
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2014-07-17  0:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 20:07 OF_DYNAMIC node lifecycle Grant Likely
     [not found] ` <CACxGe6tsXuLZT=h8S0yRPRPy6Hqz1xkX8G+ViY0cxEUuxZ1dsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-19  8:33   ` Pantelis Antoniou
     [not found]     ` <43898B58-2EA7-42B5-A17A-27F16F2618A6-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-06-23 14:58       ` Grant Likely
     [not found]         ` <20140623145844.DA6A3C40AE5-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-23 15:26           ` Pantelis Antoniou
     [not found]             ` <5213060A-74FB-4CD6-BF1C-4B7DCA98BE51-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-06-23 20:21               ` Grant Likely
2014-06-24 20:07           ` Nathan Fontenot
     [not found]             ` <53A9DA69.1040101-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-06-25 20:22               ` Grant Likely
     [not found]                 ` <20140625202216.16A8AC40AE6-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-26 19:59                   ` Nathan Fontenot
     [not found]                     ` <53AC7BA3.5030909-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-06-27 12:32                       ` Grant Likely
     [not found]                         ` <20140627123251.D0857C40859-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-27 12:40                           ` Pantelis Antoniou
     [not found]                             ` <94595B4D-1A58-427C-B9CE-C139048FEDCD-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2014-06-27 14:41                               ` Nathan Fontenot
2014-06-19 15:26   ` Nathan Fontenot
     [not found]     ` <53A30117.3010100-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-06-23 14:48       ` Grant Likely
     [not found]         ` <20140623144806.1348EC40A60-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-24 20:10           ` Nathan Fontenot
     [not found]             ` <53A9DB4F.9060708-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-06-25 20:24               ` Grant Likely
     [not found]                 ` <20140625202446.77687C40AE6-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-26 20:01                   ` Nathan Fontenot
     [not found]                     ` <53AC7C2D.3040604-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-06-27 12:41                       ` Grant Likely
     [not found]                         ` <20140627124101.367F7C40E5E-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-27 14:41                           ` Nathan Fontenot
     [not found]                             ` <53AD8296.6040702-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-07-16  5:33                               ` Grant Likely
     [not found]                                 ` <CACxGe6u5bVwYZjux9F2xzZSxZOSe37DGemCgcYtmiTP-xenQfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-16 18:30                                   ` Tyrel Datwyler
     [not found]                                     ` <53C6C4BE.6010301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-16 20:57                                       ` Grant Likely
     [not found]                                         ` <CACxGe6v8BgEcTRB-ftPVkR6Tqs3GPw_0fVuwFgff_VqawoocGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-16 22:26                                           ` Grant Likely
     [not found]                                             ` <CACxGe6scb291V9rjz2P48FxCEtXEEtOkgiQms=nZ_wdOf_cqHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-16 23:12                                               ` Nathan Fontenot
     [not found]                                                 ` <53C706D2.7080207-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>
2014-07-17  0:44                                                   ` Grant Likely [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=CACxGe6vfOa3dMoE7BYt5YAJ39yA9b0A8SJMRZiXpCsvBfQ5dOQ@mail.gmail.com \
    --to=grant.likely-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=nfont-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org \
    --cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
    --cc=turtle.in.the.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tyreld-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@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).