From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: viresh.kumar@linaro.org, edubezval@gmail.com,
kevin.wangtao@linaro.org, leo.yan@linaro.org,
vincent.guittot@linaro.org, linux-kernel@vger.kernel.org,
javi.merino@kernel.org, rui.zhang@intel.com,
daniel.thompson@linaro.org, linux-pm@vger.kernel.org,
Amit Daniel Kachhap <amit.kachhap@gmail.com>
Subject: Re: [PATCH v3 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver
Date: Fri, 13 Apr 2018 13:47:50 +0200 [thread overview]
Message-ID: <939f7943-feec-aaa2-3bd3-59a6618330c0@linaro.org> (raw)
In-Reply-To: <3f3b3b7a-3b74-aee2-2fac-f2759babe3f0@arm.com>
On 13/04/2018 13:23, Sudeep Holla wrote:
> Hi Daniel,
>
> On 05/04/18 17:16, Daniel Lezcano wrote:
>
> [...]
>
>> +/**
>> + * cpuidle_cooling_register - Idle cooling device initialization function
>> + *
>> + * This function is in charge of creating a cooling device per cluster
>> + * and register it to thermal framework. For this we rely on the
>> + * topology as there is nothing yet describing better the idle state
>> + * power domains.
>> + *
>> + * We create a cpuidle cooling device per cluster. For this reason we
>> + * must, for each cluster, allocate and initialize the cooling device
>> + * and for each cpu belonging to this cluster, do the initialization
>> + * on a cpu basis.
>> + *
>> + * This approach for creating the cooling device is needed as we don't
>> + * have the guarantee the CPU numbering is sequential.
>> + *
>> + * Unfortunately, there is no API to browse from top to bottom the
>> + * topology, cluster->cpu, only the usual for_each_possible_cpu loop.
>> + * In order to solve that, we use a cpumask to flag the cluster_id we
>> + * already processed. The cpumask will always have enough room for all
>> + * the cluster because it is based on NR_CPUS and it is not possible
>> + * to have more clusters than cpus.
>> + *
>> + */
>> +void __init cpuidle_cooling_register(void)
>> +{
>> + struct cpuidle_cooling_device *idle_cdev = NULL;
>> + struct thermal_cooling_device *cdev;
>> + struct device_node *np;
>> + cpumask_var_t cpumask;
>> + char dev_name[THERMAL_NAME_LENGTH];
>> + int ret = -ENOMEM, cpu;
>> + int cluster_id;
>> +
>> + if (!zalloc_cpumask_var(&cpumask, GFP_KERNEL))
>> + return;
>> +
>> + for_each_possible_cpu(cpu) {
>> +
>> + cluster_id = topology_physical_package_id(cpu);
>> + if (cpumask_test_cpu(cluster_id, cpumask))
>> + continue;
>
> Sorry for chiming in randomly, I haven't read the patches in detail.
> But it was brought to my notice that topology_physical_package_id is
> being used for cluster ID here. It's completely wrong and will
> changesoon with ACPI topology related changes Jeremy is working on.
>
> You will get the physical socket number(which is mostly 0 on single SoC
> system). Makes sure that this won't break with that change.
>
> Please note with cluster id not defined architecturally, relying on that
> is simply problematic.
Ok, noted. At the first glance, it should not be a problem.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2018-04-13 11:47 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 16:16 [PATCH v3 0/7] CPU cooling device new strategies Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 1/7] thermal/drivers/cpu_cooling: Fixup the header and copyright Daniel Lezcano
[not found] ` <20180411061514.GL7671@vireshk-i7>
2018-04-11 8:56 ` Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 2/7] thermal/drivers/cpu_cooling: Add Software Package Data Exchange (SPDX) Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 3/7] thermal/drivers/cpu_cooling: Remove pointless field Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 4/7] thermal/drivers/Kconfig: Convert the CPU cooling device to a choice Daniel Lezcano
[not found] ` <20180411061851.GM7671@vireshk-i7>
2018-04-11 8:58 ` Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 5/7] thermal/drivers/cpu_cooling: Add idle cooling device documentation Daniel Lezcano
2018-04-05 16:16 ` [PATCH v3 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver Daniel Lezcano
2018-04-11 8:51 ` Viresh Kumar
2018-04-11 9:29 ` Daniel Lezcano
2018-04-13 11:23 ` Sudeep Holla
2018-04-13 11:47 ` Daniel Lezcano [this message]
2018-04-16 7:37 ` Viresh Kumar
2018-04-16 7:44 ` Daniel Lezcano
2018-04-16 9:34 ` Sudeep Holla
2018-04-16 9:37 ` Viresh Kumar
2018-04-16 9:45 ` Daniel Lezcano
2018-04-16 9:50 ` Viresh Kumar
2018-04-16 10:03 ` Daniel Lezcano
2018-04-16 10:10 ` Viresh Kumar
2018-04-16 12:10 ` Daniel Lezcano
2018-04-16 12:30 ` Lorenzo Pieralisi
2018-04-16 13:57 ` Daniel Lezcano
2018-04-16 14:22 ` Lorenzo Pieralisi
2018-04-17 7:17 ` Daniel Lezcano
2018-04-17 10:24 ` Lorenzo Pieralisi
2018-04-16 12:31 ` Sudeep Holla
2018-04-16 12:49 ` Daniel Lezcano
2018-04-16 13:03 ` Sudeep Holla
2018-04-16 12:29 ` Sudeep Holla
2018-04-13 11:38 ` Daniel Thompson
2018-04-13 11:46 ` Daniel Lezcano
2019-08-05 5:11 ` Martin Kepplinger
2019-08-05 6:53 ` Martin Kepplinger
2019-08-05 7:39 ` Daniel Lezcano
2019-08-05 7:42 ` Martin Kepplinger
2019-08-05 7:58 ` Daniel Lezcano
2019-10-25 11:22 ` Martin Kepplinger
2019-10-25 14:45 ` Daniel Lezcano
2019-10-26 18:23 ` Martin Kepplinger
2019-10-28 15:16 ` Daniel Lezcano
2019-08-05 7:37 ` Daniel Lezcano
2019-08-05 7:40 ` Martin Kepplinger
2018-04-05 16:16 ` [PATCH v3 7/7] cpuidle/drivers/cpuidle-arm: Register the cooling device Daniel Lezcano
2018-04-11 8:51 ` 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=939f7943-feec-aaa2-3bd3-59a6618330c0@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=amit.kachhap@gmail.com \
--cc=daniel.thompson@linaro.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@kernel.org \
--cc=kevin.wangtao@linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--subject='Re: [PATCH v3 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver' \
/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
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).