linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	nm@ti.com, sboyd@codeaurora.org, linaro-kernel@lists.linaro.org,
	linux-pm@vger.kernel.org, khilman@linaro.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Len Brown <len.brown@intel.com>,
	open list <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH V2 1/6] PM / OPP: Free resources and properly return error on failure
Date: Wed, 12 Aug 2015 12:13:09 +0530	[thread overview]
Message-ID: <20150812064309.GL32049@linux> (raw)
In-Reply-To: <20150811171132.GA25166@mwanda>

On 11-08-15, 20:11, Dan Carpenter wrote:
> On Tue, Aug 11, 2015 at 08:29:38PM +0530, Viresh Kumar wrote:
> > > This is weird to me, because we are going backwards.  What happens if
> > > we goto free_table without adding anything?
> > 
> > It will WARN() today.
> 
> Then the current code is buggy.

Urg, it wouldn't WARN in this case. Sorry, didn't read it correctly
earlier.

> > > I suspect it's fine, but if
> > > it's a bug then this code still has problems.
> > 
> > I don't think we have a bug here, we never added anything and so don't
> > need to free it.
> > 
> > > What about if we only increment count when _opp_add_static_v2()
> > > succeeds
> > 
> > That's not what we want.
> 
> If the first call to _opp_add_static_v2() fails we call
> of_free_opp_table() and you say that triggers a WARN().

No it doesn't.

So, coming back to the point you made about freeing table on !count,
because there were no nodes present in the DT opp table, we have never
tried to add any OPPs. And so there is no need to call
of_free_opp_table() in that case.

Do you still think the current code is wrong ?

-- 
viresh

  reply	other threads:[~2015-08-12  6:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 10:34 [PATCH V2 0/6] PM / OPP: Add debugfs support Viresh Kumar
2015-08-11 10:34 ` [PATCH V2 1/6] PM / OPP: Free resources and properly return error on failure Viresh Kumar
2015-08-11 14:43   ` Dan Carpenter
2015-08-11 14:59     ` Viresh Kumar
2015-08-11 17:11       ` Dan Carpenter
2015-08-12  6:43         ` Viresh Kumar [this message]
2015-08-12  8:11           ` Dan Carpenter
2015-08-12  8:23             ` Viresh Kumar
2015-08-12  9:03               ` Dan Carpenter
2015-08-12 10:10                 ` Viresh Kumar
2015-08-12 10:52                   ` Dan Carpenter
2015-08-11 10:34 ` [PATCH V2 2/6] PM / OPP: reuse of_parse_phandle() Viresh Kumar
2015-08-11 10:34 ` [PATCH V2 3/6] PM / OPP: Prefix exported opp routines with dev_pm_opp_ Viresh Kumar
2015-08-11 10:34 ` [PATCH V2 4/6] PM / OPP: Move opp core to its own directory Viresh Kumar
2015-08-11 10:34 ` [PATCH V2 5/6] PM / OPP: Move cpu specific code to opp/cpu.c Viresh Kumar
2015-08-11 10:34 ` [PATCH V2 6/6] PM / OPP: Add debugfs support 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=20150812064309.GL32049@linux \
    --to=viresh.kumar@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.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).