From: Viresh Kumar <viresh.kumar@linaro.org>
To: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table
Date: Tue, 7 Jul 2015 15:57:44 +0530 [thread overview]
Message-ID: <20150707102744.GK14598@linux> (raw)
In-Reply-To: <1435723994-3882-1-git-send-email-pi-cheng.chen@linaro.org>
On 01-07-15, 12:13, Pi-Cheng Chen wrote:
> Sorry for the mistake I made when cherry-picking the patch. Fix and resend
> again.
You really want above to show up in git logs ?
Any comments like this should be present:
- in cover-letter
- OR after the three dashes below ---
- OR must be followed with a scissors line, like this:
--------------8<--------
> __cpufreq_cooling_register() might fail if some CPU other than first one in
> clip_cpu mask is present earlier e.g. CPU hotplug. Iterate all CPUs in the mask
> to handle this case.
>
> Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
> ---
> drivers/thermal/cpu_cooling.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index 6509c61..5e90eb6 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -776,9 +776,14 @@ __cpufreq_cooling_register(struct device_node *np,
> char dev_name[THERMAL_NAME_LENGTH];
> struct cpufreq_frequency_table *pos, *table;
> unsigned int freq, i, num_cpus;
> - int ret;
> + int ret, cpu;
> +
> + for_each_cpu(cpu, clip_cpus) {
> + table = cpufreq_frequency_get_table(cpu);
> + if (table)
> + break;
> + }
>
> - table = cpufreq_frequency_get_table(cpumask_first(clip_cpus));
Nah, that's wrong. I hope that's a hypothetical problem and not a real
one. Would have been better if cpufreq maintainers were cc'd as they
can provide more insight into this :)
cpufreq_frequency_get_table() does: policy->freq_table and so it
doesn't matter if the cpu is online or not.
cpufreq_cpu_data was getting unset earlier on hotplug, but that's not
the case anymore. So nothing to worry about :)
--
viresh
WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table
Date: Tue, 7 Jul 2015 15:57:44 +0530 [thread overview]
Message-ID: <20150707102744.GK14598@linux> (raw)
In-Reply-To: <1435723994-3882-1-git-send-email-pi-cheng.chen@linaro.org>
On 01-07-15, 12:13, Pi-Cheng Chen wrote:
> Sorry for the mistake I made when cherry-picking the patch. Fix and resend
> again.
You really want above to show up in git logs ?
Any comments like this should be present:
- in cover-letter
- OR after the three dashes below ---
- OR must be followed with a scissors line, like this:
--------------8<--------
> __cpufreq_cooling_register() might fail if some CPU other than first one in
> clip_cpu mask is present earlier e.g. CPU hotplug. Iterate all CPUs in the mask
> to handle this case.
>
> Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
> ---
> drivers/thermal/cpu_cooling.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index 6509c61..5e90eb6 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -776,9 +776,14 @@ __cpufreq_cooling_register(struct device_node *np,
> char dev_name[THERMAL_NAME_LENGTH];
> struct cpufreq_frequency_table *pos, *table;
> unsigned int freq, i, num_cpus;
> - int ret;
> + int ret, cpu;
> +
> + for_each_cpu(cpu, clip_cpus) {
> + table = cpufreq_frequency_get_table(cpu);
> + if (table)
> + break;
> + }
>
> - table = cpufreq_frequency_get_table(cpumask_first(clip_cpus));
Nah, that's wrong. I hope that's a hypothetical problem and not a real
one. Would have been better if cpufreq maintainers were cc'd as they
can provide more insight into this :)
cpufreq_frequency_get_table() does: policy->freq_table and so it
doesn't matter if the cpu is online or not.
cpufreq_cpu_data was getting unset earlier on hotplug, but that's not
the case anymore. So nothing to worry about :)
--
viresh
next prev parent reply other threads:[~2015-07-07 10:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 4:07 [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table Pi-Cheng Chen
2015-07-01 4:07 ` Pi-Cheng Chen
2015-07-01 4:13 ` Pi-Cheng Chen
2015-07-01 4:13 ` Pi-Cheng Chen
2015-07-07 7:52 ` Javi Merino
2015-07-07 7:52 ` Javi Merino
2015-07-07 10:27 ` Viresh Kumar [this message]
2015-07-07 10:27 ` Viresh Kumar
2015-07-08 1:50 ` Pi-Cheng Chen
2015-07-08 1:50 ` Pi-Cheng Chen
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=20150707102744.GK14598@linux \
--to=viresh.kumar@linaro.org \
--cc=edubezval@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pi-cheng.chen@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.