linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] opp: of: drop incorrect lockdep_assert_held()
@ 2019-10-10 10:30 Viresh Kumar
  2019-10-23  5:30 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2019-10-10 10:30 UTC (permalink / raw)
  To: Viresh Kumar, Nishanth Menon, Stephen Boyd
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Rafael Wysocki, v5 . 0+,
	Niklas Cassel, linux-kernel

_find_opp_of_np() doesn't traverse the list of OPP tables but instead
just the entries within an OPP table and so only requires to lock the
OPP table itself.

The lockdep_assert_held() was added there by mistake and isn't really
required.

Fixes: 5d6d106fa455 ("OPP: Populate required opp tables from "required-opps" property")
Cc: v5.0+ <stable@vger.kernel.org> # v5.0+
Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/opp/of.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 1813f5ad5fa2..6dc41faf74b5 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -77,8 +77,6 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
 {
 	struct dev_pm_opp *opp;
 
-	lockdep_assert_held(&opp_table_lock);
-
 	mutex_lock(&opp_table->lock);
 
 	list_for_each_entry(opp, &opp_table->opp_list, node) {
-- 
2.21.0.rc0.269.g1a574e7a288b


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] opp: of: drop incorrect lockdep_assert_held()
  2019-10-10 10:30 [PATCH] opp: of: drop incorrect lockdep_assert_held() Viresh Kumar
@ 2019-10-23  5:30 ` Viresh Kumar
  2019-10-23 12:01   ` Niklas Cassel
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2019-10-23  5:30 UTC (permalink / raw)
  To: Viresh Kumar, Nishanth Menon, Stephen Boyd
  Cc: linux-pm, Vincent Guittot, Rafael Wysocki, v5 . 0+,
	Niklas Cassel, linux-kernel

On 10-10-19, 16:00, Viresh Kumar wrote:
> _find_opp_of_np() doesn't traverse the list of OPP tables but instead
> just the entries within an OPP table and so only requires to lock the
> OPP table itself.
> 
> The lockdep_assert_held() was added there by mistake and isn't really
> required.
> 
> Fixes: 5d6d106fa455 ("OPP: Populate required opp tables from "required-opps" property")
> Cc: v5.0+ <stable@vger.kernel.org> # v5.0+
> Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/opp/of.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> index 1813f5ad5fa2..6dc41faf74b5 100644
> --- a/drivers/opp/of.c
> +++ b/drivers/opp/of.c
> @@ -77,8 +77,6 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
>  {
>  	struct dev_pm_opp *opp;
>  
> -	lockdep_assert_held(&opp_table_lock);
> -
>  	mutex_lock(&opp_table->lock);
>  
>  	list_for_each_entry(opp, &opp_table->opp_list, node) {

@Niklas, any inputs from your side  here would be appreciated :)

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] opp: of: drop incorrect lockdep_assert_held()
  2019-10-23  5:30 ` Viresh Kumar
@ 2019-10-23 12:01   ` Niklas Cassel
  2019-10-24  2:56     ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Niklas Cassel @ 2019-10-23 12:01 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Viresh Kumar, Nishanth Menon, Stephen Boyd, linux-pm,
	Vincent Guittot, Rafael Wysocki, v5 . 0+,
	linux-kernel

On Wed, Oct 23, 2019 at 11:00:05AM +0530, Viresh Kumar wrote:
> On 10-10-19, 16:00, Viresh Kumar wrote:
> > _find_opp_of_np() doesn't traverse the list of OPP tables but instead
> > just the entries within an OPP table and so only requires to lock the
> > OPP table itself.
> > 
> > The lockdep_assert_held() was added there by mistake and isn't really
> > required.
> > 
> > Fixes: 5d6d106fa455 ("OPP: Populate required opp tables from "required-opps" property")
> > Cc: v5.0+ <stable@vger.kernel.org> # v5.0+
> > Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> >  drivers/opp/of.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> > index 1813f5ad5fa2..6dc41faf74b5 100644
> > --- a/drivers/opp/of.c
> > +++ b/drivers/opp/of.c
> > @@ -77,8 +77,6 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
> >  {
> >  	struct dev_pm_opp *opp;
> >  
> > -	lockdep_assert_held(&opp_table_lock);
> > -
> >  	mutex_lock(&opp_table->lock);
> >  
> >  	list_for_each_entry(opp, &opp_table->opp_list, node) {
> 
> @Niklas, any inputs from your side  here would be appreciated :)

Tested-by: Niklas Cassel <niklas.cassel@linaro.org>

After this patch, there is still a single lockdep_assert_held()
left, inside _find_table_of_opp_np(), since you kept this,
I assume that that one is still needed?

Kind regards,
Niklas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] opp: of: drop incorrect lockdep_assert_held()
  2019-10-23 12:01   ` Niklas Cassel
@ 2019-10-24  2:56     ` Viresh Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2019-10-24  2:56 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Viresh Kumar, Nishanth Menon, Stephen Boyd, linux-pm,
	Vincent Guittot, Rafael Wysocki, v5 . 0+,
	linux-kernel

On 23-10-19, 14:01, Niklas Cassel wrote:
> On Wed, Oct 23, 2019 at 11:00:05AM +0530, Viresh Kumar wrote:
> > On 10-10-19, 16:00, Viresh Kumar wrote:
> > > _find_opp_of_np() doesn't traverse the list of OPP tables but instead
> > > just the entries within an OPP table and so only requires to lock the
> > > OPP table itself.
> > > 
> > > The lockdep_assert_held() was added there by mistake and isn't really
> > > required.
> > > 
> > > Fixes: 5d6d106fa455 ("OPP: Populate required opp tables from "required-opps" property")
> > > Cc: v5.0+ <stable@vger.kernel.org> # v5.0+
> > > Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
> > > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > > ---
> > >  drivers/opp/of.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > > 
> > > diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> > > index 1813f5ad5fa2..6dc41faf74b5 100644
> > > --- a/drivers/opp/of.c
> > > +++ b/drivers/opp/of.c
> > > @@ -77,8 +77,6 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
> > >  {
> > >  	struct dev_pm_opp *opp;
> > >  
> > > -	lockdep_assert_held(&opp_table_lock);
> > > -
> > >  	mutex_lock(&opp_table->lock);
> > >  
> > >  	list_for_each_entry(opp, &opp_table->opp_list, node) {
> > 
> > @Niklas, any inputs from your side  here would be appreciated :)
> 
> Tested-by: Niklas Cassel <niklas.cassel@linaro.org>
> 
> After this patch, there is still a single lockdep_assert_held()
> left, inside _find_table_of_opp_np(), since you kept this,
> I assume that that one is still needed?

Yeah, that one is required as we are traversing the list of OPP tables
there.

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-24  2:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 10:30 [PATCH] opp: of: drop incorrect lockdep_assert_held() Viresh Kumar
2019-10-23  5:30 ` Viresh Kumar
2019-10-23 12:01   ` Niklas Cassel
2019-10-24  2:56     ` Viresh Kumar

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).