summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2023-08-25 13:26:26 +0200
committerSudeep Holla <sudeep.holla@arm.com>2023-09-21 17:24:27 +0200
commit4f1f0bc8ed1647007ad4ad8d2b8ce0092bb22d43 (patch)
tree088eeb935b63918a761f716dad27589f7155b248 /drivers/cpufreq
parentfirmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops (diff)
downloadlinux-4f1f0bc8ed1647007ad4ad8d2b8ce0092bb22d43.tar.xz
linux-4f1f0bc8ed1647007ad4ad8d2b8ce0092bb22d43.zip
cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
The domain-id for the cpu_dev has already been parsed at the point when scmi_get_sharing_cpus() is getting called. Let's pass it as an in-parameter to avoid the unnecessary OF parsing. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/20230825112633.236607-7-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/scmi-cpufreq.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index 125e8a8421fb..78f53e388094 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -82,15 +82,12 @@ static int scmi_cpu_domain_id(struct device *cpu_dev)
}
static int
-scmi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
+scmi_get_sharing_cpus(struct device *cpu_dev, int domain,
+ struct cpumask *cpumask)
{
- int cpu, domain, tdomain;
+ int cpu, tdomain;
struct device *tcpu_dev;
- domain = scmi_cpu_domain_id(cpu_dev);
- if (domain < 0)
- return domain;
-
for_each_possible_cpu(cpu) {
if (cpu == cpu_dev->id)
continue;
@@ -163,7 +160,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
}
/* Obtain CPUs that share SCMI performance controls */
- ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus);
+ ret = scmi_get_sharing_cpus(cpu_dev, domain, policy->cpus);
if (ret) {
dev_warn(cpu_dev, "failed to get sharing cpumask\n");
goto out_free_cpumask;