devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: atull <atull@opensource.altera.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Frank Rowand <frowand.list@gmail.com>,
	Grant Likely <grant.likely@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Moritz Fischer <moritz.fischer@ettus.com>,
	Pantelis Antoniou <pantelis.antoniou@gmail.com>,
	Alan Tull <delicious.quinoa@gmail.com>,
	Dinh Nguyen <dinguyen@opensource.altera.com>
Subject: Re: [PATCH] of/overlay: add of overlay notifications
Date: Thu, 3 Mar 2016 09:11:26 -0600	[thread overview]
Message-ID: <alpine.DEB.2.02.1603030911110.18468@linuxheads99> (raw)
In-Reply-To: <CAL_JsqKxVPMZvYfy-UN4LfUWzUqiAAOz1XCB6R5phXHDEEkj4g@mail.gmail.com>

On Thu, 3 Mar 2016, Rob Herring wrote:

> On Wed, Mar 2, 2016 at 12:49 PM, atull <atull@opensource.altera.com> wrote:
> > On Wed, 2 Mar 2016, Rob Herring wrote:
> >
> >> On Fri, Feb 26, 2016 at 3:44 PM, Alan Tull <atull@opensource.altera.com> wrote:
> >> > This patch add of overlay notifications.
> >> >
> >> > When DT overlays are being added, some drivers/subsystems
> >> > need to see device tree overlays before the changes go into
> >> > the live tree.
> 
> [...]
> 
> >> > @@ -389,6 +431,8 @@ int of_overlay_create(struct device_node *tree)
> >> >         /* add to the tail of the overlay list */
> >> >         list_add_tail(&ov->node, &ov_list);
> >> >
> >> > +       of_overlay_notify(ov, OF_OVERLAY_POST_APPLY);
> >> > +
> >> >         mutex_unlock(&of_mutex);
> >>
> >> This means that any post-apply handlers can't make any calls that take
> >> the mutex. Maybe that is fine? On the flip side, maybe we want to
> >> prevent any changes while the notifiers are called.
> >>
> >> The other calls could have similar issues. We should make sure we are
> >> consistent.
> >>
> >
> > Currently it's consistent - all 4 notifiers hold the mutex,
> > so all 4 prevent dt changes.  That's not super bad, but it's
> > different from the reconfig notifiers and I could see some
> > possible usefulness in allowing changes.
> >
> > I don't see any harm in unlocking for pre-apply, post-apply,
> > or post-remove.  But for pre-remove, unlocking would allow
> > notifier code to make changes to the overlay's changeset
> > that is about to be removed.  Is that something we need to
> > be super worried about preventing?
> >
> > For pre-apply, unlocking would allow changes to either the
> > live tree or the overlay. That's ok since the next thing
> > that will happen after the notifier is that the changeset
> > will be built from the overlay, so any changes made to the
> > overlay would make it into the changeset before it is
> > applied.  Post-apply and post-remove are also ok to
> > be unlocked.
> >
> > So if the pre-remove case is ok, I could release the mutex
> > for all 4 cases in v3.
> 
> The only one I can see it being useful to make changes would be
> pre-apply. The complication there is you would have to move the mutex.
> I don't think the mutex really needs to be held until before
> of_overlay_apply, but I'm not completely sure. For now, I think just
> leave things as they are now.
> 
> Rob
> 

OK

Alan

  reply	other threads:[~2016-03-03 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 21:44 [PATCH] of/overlay: add of overlay notifications Alan Tull
     [not found] ` <1456523056-15352-1-git-send-email-atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2016-03-02  2:27   ` Rob Herring
     [not found]     ` <CAL_Jsq+kkBBV=pYxn54ZRTCnj=cNDKw4o6qJ+z_Ze3JGLRq+aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-02 18:49       ` atull
2016-03-03 14:24         ` Rob Herring
2016-03-03 15:11           ` atull [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-02-25 23:36 Alan Tull
     [not found] ` <1456443382-29781-1-git-send-email-atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2016-02-26  0:03   ` kbuild test robot
2016-02-26  1:14 ` atull

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=alpine.DEB.2.02.1603030911110.18468@linuxheads99 \
    --to=atull@opensource.altera.com \
    --cc=delicious.quinoa@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moritz.fischer@ettus.com \
    --cc=pantelis.antoniou@gmail.com \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robh+dt@kernel.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).