All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	cw00.choi@samsung.com, Viresh Kumar <vireshk@kernel.org>,
	Nishanth Menon <nm@ti.com>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	myungjoo.ham@samsung.com, inki.dae@samsung.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / OPP: Call notifier without holding opp_table->lock
Date: Wed, 20 Sep 2017 12:47:20 -0700	[thread overview]
Message-ID: <20170920194720.GB457@codeaurora.org> (raw)
In-Reply-To: <20170920170755.GA3001@ubuntu>

On 09/20, Viresh Kumar wrote:
> On 20-09-17, 10:00, Stephen Boyd wrote:
> > On 09/20, Viresh Kumar wrote:
> 
> > > diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
> > > index 4360b4efcd4c..668fd940d362 100644
> > > --- a/drivers/base/power/opp/core.c
> > > +++ b/drivers/base/power/opp/core.c
> > > @@ -1627,6 +1627,9 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
> > >  
> > >  	opp->available = availability_req;
> > >  
> > > +	dev_pm_opp_get(opp);
> > > +	mutex_unlock(&opp_table->lock);
> > 
> > Does this prevent the OPP from changing while the lock is
> > released?
> 
> No, its just ref counting and will only prevent it from getting freed.
> 
> There is only one thing that can change for an OPP though after it is
> created, its availability.

Ok.

> 
> > That would be the only difference from before. It's
> > possible that nobody cares about this situation though.
> 
> I am not sure if its worth caring for right now :)
> 
> Also the notifier chain will not start again until the previous call
> chain is finished. So we are kind of synchronized here.
> 

Yep. Just me worrying out loud. You can add my

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-09-20 19:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170920102206epcas1p2ae5b3a2020efa368f6c0640403695cbd@epcas1p2.samsung.com>
2017-09-20 10:22 ` OPP's mutex locking issue Chanwoo Choi
2017-09-20 15:34   ` [PATCH] PM / OPP: Call notifier without holding opp_table->lock Viresh Kumar
2017-09-20 17:00     ` Stephen Boyd
2017-09-20 17:07       ` Viresh Kumar
2017-09-20 19:47         ` Stephen Boyd [this message]
2017-09-20 20:25   ` [PATCH V2] " Viresh Kumar
2017-09-20 23:58     ` Chanwoo Choi
2017-09-21 17:44   ` [PATCH V3] " Viresh Kumar

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=20170920194720.GB457@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=cw00.choi@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@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 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.