Commit e7b1cc9a authored by Lukasz Luba's avatar Lukasz Luba Committed by Rafael J. Wysocki

PM: EM: Extend em_cpufreq_update_efficiencies() argument list

In order to prepare the code for the modifiable EM perf_state table,
make em_cpufreq_update_efficiencies() take a pointer to the EM table
as its second argument and modify it to use that new argument instead
of the 'table' member of dev->em_pd.

No functional impact.
Reviewed-by: default avatarHongyan Xia <hongyan.xia2@arm.com>
Reviewed-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4274521f
...@@ -237,15 +237,15 @@ static int em_create_pd(struct device *dev, int nr_states, ...@@ -237,15 +237,15 @@ static int em_create_pd(struct device *dev, int nr_states,
return 0; return 0;
} }
static void em_cpufreq_update_efficiencies(struct device *dev) static void
em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table)
{ {
struct em_perf_domain *pd = dev->em_pd; struct em_perf_domain *pd = dev->em_pd;
struct em_perf_state *table;
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
int found = 0; int found = 0;
int i; int i;
if (!_is_cpu_device(dev) || !pd) if (!_is_cpu_device(dev))
return; return;
policy = cpufreq_cpu_get(cpumask_first(em_span_cpus(pd))); policy = cpufreq_cpu_get(cpumask_first(em_span_cpus(pd)));
...@@ -254,8 +254,6 @@ static void em_cpufreq_update_efficiencies(struct device *dev) ...@@ -254,8 +254,6 @@ static void em_cpufreq_update_efficiencies(struct device *dev)
return; return;
} }
table = pd->table;
for (i = 0; i < pd->nr_perf_states; i++) { for (i = 0; i < pd->nr_perf_states; i++) {
if (!(table[i].flags & EM_PERF_STATE_INEFFICIENT)) if (!(table[i].flags & EM_PERF_STATE_INEFFICIENT))
continue; continue;
...@@ -397,7 +395,7 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, ...@@ -397,7 +395,7 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
dev->em_pd->flags |= flags; dev->em_pd->flags |= flags;
em_cpufreq_update_efficiencies(dev); em_cpufreq_update_efficiencies(dev, dev->em_pd->table);
em_debug_create_pd(dev); em_debug_create_pd(dev);
dev_info(dev, "EM: created perf domain\n"); dev_info(dev, "EM: created perf domain\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment