From: Leo Yan <leo.yan@linaro.org>
To: Javi Merino <javi.merino@arm.com>
Cc: Eduardo Valentin <edubezval@gmail.com>,
linux-pm@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>,
linux-kernel@vger.kernel.org,
Punit Agrawal <Punit.Agrawal@arm.com>
Subject: Re: Regard of thermal power allocator's coefficients
Date: Fri, 19 Feb 2016 17:03:12 +0800 [thread overview]
Message-ID: <20160219090312.GB21660@leoy-linaro> (raw)
In-Reply-To: <20160218151926.GA4511@e104805>
Hi Javi,
On Thu, Feb 18, 2016 at 03:19:26PM +0000, Javi Merino wrote:
> On Mon, Feb 15, 2016 at 12:47:51PM +0800, Leo Yan wrote:
[...]
> > > > So want to firstly to confirm if should we pass coefficients by using
> > > > device tree? Is someone working on related work for this?
> > >
> > > We pass the sustainable power, but not the coefficients. IIRC, the IPA
> > > coefficients were considered (SW) implementation details. Sustainable power,
> > > on the other hand, still describes hardware capabilities.
> > >
> > > So, I don't think they will go via DT.
> >
> > I'd like clarify one thing: "coefficients" are used to calculate
> > static leakage and dynamic power but not PID's term constants. They
> > are quite dependent on silicon's process; this is similiar with
> > sustainable power. So do you think we should take these "coefficients"
> > as software paramters?
>
> For the dynamic power coefficient there is a binding in the cpu node
> of DT, see Documentation/devicetree/bindings/arm/cpus.txt [0]. If you
> use the cpufreq-dt driver, it will be registered automatically for
> you.
>
> [0] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/arm/cpus.txt#n249
>
> For static, sadly we don't have anything currently and as far as I'm
> aware nobody is working on it. The main problem with static power is
> that there is no single formula that applies for different SoCs.
> That's why we left it as a function pointer.
Thanks for pointing out; I recognized Punit has committed patch for
dynamic coefficient finally.
So far we also simplize power model on Hikey with only dynamic
coefficient, later will send out patch for review.
Thanks,
Leo Yan
>
> HTH,
> Javi
>
> > The code is written in drivers/thermal/hisi_thermal.c like below:
> >
> > ---8<---
> >
> > struct cluster_power_coefficients cluster_data = {
> > .dyn_coeff = 266,
> > .static_cpu = 14,
> > .static_cluster = 5,
> > };
> >
> > /* voltage in uV and temperature in mC */
> > static int get_static_power(cpumask_t *cpumask, int interval,
> > unsigned long u_volt, u32 *power)
> > {
> > int nr_cpus = cpumask_weight(cpumask);
> >
> > *power = nr_cpus * cluster_data.static_cpu;
> > *power += 2 * cluster_data.static_cluster;
> >
> > return 0;
> > }
> >
> > static int hisi_thermal_register_cooling_device(struct platform_device *pdev,
> > struct hisi_thermal_data *data)
> > {
> > struct device_node *np;
> >
> > np = of_find_node_by_name(NULL, "cluster0");
> > if (!np) {
> > dev_err(&pdev->dev, "Cluster0 node not founds\n");
> > return -ENODEV;
> > }
> >
> > data->cdevs = of_cpufreq_power_cooling_register(np,
> > cpu_present_mask, cluster_data.dyn_coeff,
> > get_static_power);
> > if (IS_ERR(data->cdevs)) {
> > dev_err(&pdev->dev,
> > "Error registering cooling device: %ld\n",
> > PTR_ERR(data->cdevs));
> > return PTR_ERR(data->cdevs);
> > }
> >
> > return 0;
> > }
> >
> > Thanks,
> > Leo Yan
> >
prev parent reply other threads:[~2016-02-19 9:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-14 11:00 Regard of thermal power allocator's coefficients Leo Yan
2016-02-14 17:12 ` Eduardo Valentin
2016-02-15 4:47 ` Leo Yan
2016-02-18 15:19 ` Javi Merino
2016-02-19 9:03 ` Leo Yan [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=20160219090312.GB21660@leoy-linaro \
--to=leo.yan@linaro.org \
--cc=Punit.Agrawal@arm.com \
--cc=edubezval@gmail.com \
--cc=javi.merino@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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).