[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2010024.PYKUYFuaPT@rjwysocki.net>
Date: Fri, 29 Nov 2024 17:06:52 +0100
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Lukasz Luba <lukasz.luba@....com>,
Peter Zijlstra <peterz@...radead.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Morten Rasmussen <morten.rasmussen@....com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Pierre Gondois <pierre.gondois@....com>
Subject:
[RFC][PATCH v021 6/9] PM: EM: Call em_compute_costs() from
em_create_perf_table()
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
In preparation for subsequent changes, move the em_compute_costs()
invocation from em_create_perf_table() to em_create_pd() which is its
only caller.
This helps to prepare the EM registration code for handling the case in
which the :active_power() EM callback is NULL.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
v0.1 -> v0.2: Update changelog to explain what subsequent change depends
on this patch.
---
kernel/power/energy_model.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-pm/kernel/power/energy_model.c
===================================================================
--- linux-pm.orig/kernel/power/energy_model.c
+++ linux-pm/kernel/power/energy_model.c
@@ -388,10 +388,6 @@ static int em_create_perf_table(struct d
em_init_performance(dev, pd, table, nr_states);
- ret = em_compute_costs(dev, table, cb, nr_states, flags);
- if (ret)
- return -EINVAL;
-
return 0;
}
@@ -434,6 +430,10 @@ static int em_create_pd(struct device *d
if (ret)
goto free_pd_table;
+ ret = em_compute_costs(dev, em_table->state, cb, nr_states, flags);
+ if (ret)
+ goto free_pd_table;
+
rcu_assign_pointer(pd->em_table, em_table);
if (_is_cpu_device(dev))
Powered by blists - more mailing lists