Linux Power Management development
 help / color / mirror / Atom feed
From: Quentin Perret <quentin.perret@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, rjw@rjwysocki.net, vireshk@kernel.org,
	nm@ti.com, sboyd@codeaurora.org, sudeep.holla@arm.com,
	amit.kachhap@gmail.com, javi.merino@kernel.org,
	rui.zhang@intel.com, edubezval@gmail.com, matthias.bgg@gmail.com,
	dietmar.eggemann@arm.com, morten.rasmussen@arm.com,
	patrick.bellasi@arm.com, ionela.voinescu@arm.com,
	joelaf@google.com, tkjos@google.com
Subject: Re: [PATCH v2 2/2] thermal: cpu_cooling: use power models from the OPP library
Date: Wed, 17 Jan 2018 10:29:51 +0000	[thread overview]
Message-ID: <20180117102951.GF23988@e108498-lin.cambridge.arm.com> (raw)
In-Reply-To: <20180117053950.GM22978@vireshk-i7>

On Wednesday 17 Jan 2018 at 11:09:50 (+0530), Viresh Kumar wrote:
> On 16-01-18, 16:51, Quentin Perret wrote:
> > @@ -760,7 +746,7 @@ of_cpufreq_cooling_register(struct cpufreq_policy *policy)
> >  {
> >  	struct device_node *np = of_get_cpu_node(policy->cpu, NULL);
> >  	struct thermal_cooling_device *cdev = NULL;
> > -	u32 capacitance = 0;
> > +	bool has_power;
> >  
> >  	if (!np) {
> >  		pr_err("cpu_cooling: OF node not available for cpu%d\n",
> > @@ -769,10 +755,9 @@ of_cpufreq_cooling_register(struct cpufreq_policy *policy)
> >  	}
> >  
> >  	if (of_find_property(np, "#cooling-cells", NULL)) {
> > -		of_property_read_u32(np, "dynamic-power-coefficient",
> > -				     &capacitance);
> > +		has_power = dev_pm_opp_has_power(get_cpu_device(policy->cpu));
> 
> Use of_find_property() here, as I pointed out in the other commit.

As I mentioned in the other commit, what I suggest here is to call
__cpufreq_cooling_register() with has_power=true unconditionally here
and to bail out from update_freq_table cleanly whenever
dev_pm_opp_get_power() returns 0.

> 
> -- 
> viresh

      reply	other threads:[~2018-01-17 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 16:51 [PATCH v2 0/2] thermal, OPP: move the CPU power estimation to the OPP library Quentin Perret
2018-01-16 16:51 ` [PATCH v2 1/2] PM / OPP: introduce an OPP power estimation helper Quentin Perret
2018-01-17  5:37   ` Viresh Kumar
2018-01-17 10:27     ` Quentin Perret
2018-01-17 10:41       ` Viresh Kumar
2018-01-17 10:59         ` Quentin Perret
2018-01-16 16:51 ` [PATCH v2 2/2] thermal: cpu_cooling: use power models from the OPP library Quentin Perret
2018-01-17  5:39   ` Viresh Kumar
2018-01-17 10:29     ` Quentin Perret [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=20180117102951.GF23988@e108498-lin.cambridge.arm.com \
    --to=quentin.perret@arm.com \
    --cc=amit.kachhap@gmail.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=edubezval@gmail.com \
    --cc=ionela.voinescu@arm.com \
    --cc=javi.merino@kernel.org \
    --cc=joelaf@google.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=morten.rasmussen@arm.com \
    --cc=nm@ti.com \
    --cc=patrick.bellasi@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=sboyd@codeaurora.org \
    --cc=sudeep.holla@arm.com \
    --cc=tkjos@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox