From: Ionela Voinescu <ionela.voinescu@arm.com>
To: rjw@rjwysocki.net, viresh.kumar@linaro.org, lenb@kernel.org
Cc: yousaf.kaukab@suse.com, jeremy.linton@arm.com,
lukasz.luba@arm.com, valentin.schneider@arm.com,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, ionela.voinescu@arm.com
Subject: [PATCH v2 1/4] cppc_cpufreq: use policy->cpu as driver of frequency setting
Date: Mon, 14 Dec 2020 12:38:20 +0000 [thread overview]
Message-ID: <20201214123823.3949-2-ionela.voinescu@arm.com> (raw)
In-Reply-To: <20201214123823.3949-1-ionela.voinescu@arm.com>
Considering only the currently supported coordination types (ANY, HW,
NONE), this change only makes a difference for the ANY type, when
policy->cpu is hotplugged out. In that case the new policy->cpu will
be different from ((struct cppc_cpudata *)policy->driver_data)->cpu.
While in this case the controls of *ANY* CPU could be used to drive
frequency changes, it's more consistent to use policy->cpu as the
leading CPU, as used in all other cppc_cpufreq functions. Additionally,
the debug prints in cppc_set_perf() would no longer create confusion
when referring to a CPU that is hotplugged out.
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cppc_cpufreq.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 7cc9bd8568de..2700fc71d4e8 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -150,6 +150,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
unsigned int relation)
{
struct cppc_cpudata *cpu_data = all_cpu_data[policy->cpu];
+ unsigned int cpu = policy->cpu;
struct cpufreq_freqs freqs;
u32 desired_perf;
int ret = 0;
@@ -164,12 +165,12 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
freqs.new = target_freq;
cpufreq_freq_transition_begin(policy, &freqs);
- ret = cppc_set_perf(cpu_data->cpu, &cpu_data->perf_ctrls);
+ ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
cpufreq_freq_transition_end(policy, &freqs, ret != 0);
if (ret)
pr_debug("Failed to set target on CPU:%d. ret:%d\n",
- cpu_data->cpu, ret);
+ cpu, ret);
return ret;
}
--
2.29.2.dirty
next prev parent reply other threads:[~2020-12-14 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 12:38 [PATCH v2 0/4] cppc_cpufreq: fix, clarify and improve support Ionela Voinescu
2020-12-14 12:38 ` Ionela Voinescu [this message]
2020-12-14 12:38 ` [PATCH v2 2/4] cppc_cpufreq: clarify support for coordination types Ionela Voinescu
2020-12-14 12:38 ` [PATCH v2 3/4] cppc_cpufreq: expose information on frequency domains Ionela Voinescu
2020-12-14 12:38 ` [PATCH v2 4/4] cppc_cpufreq: replace per-cpu data array with a list Ionela Voinescu
2020-12-14 16:11 ` [PATCH v2 0/4] cppc_cpufreq: fix, clarify and improve support Mian Yousaf Kaukab
2020-12-15 18:21 ` Rafael J. Wysocki
2020-12-15 23:31 ` Ionela Voinescu
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=20201214123823.3949-2-ionela.voinescu@arm.com \
--to=ionela.voinescu@arm.com \
--cc=jeremy.linton@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rjw@rjwysocki.net \
--cc=valentin.schneider@arm.com \
--cc=viresh.kumar@linaro.org \
--cc=yousaf.kaukab@suse.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).