public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Cc: lukasz.luba@arm.com, Dietmar.Eggemann@arm.com,
	cristian.marussi@arm.com, morten.rasmussen@arm.com,
	viresh.kumar@linaro.org, rafael@kernel.org
Subject: [PATCH 2/2] cpufreq: arm_scmi: Discover the power scale in performance protocol
Date: Tue, 24 Nov 2020 10:43:46 +0000	[thread overview]
Message-ID: <20201124104346.27167-3-lukasz.luba@arm.com> (raw)
In-Reply-To: <20201124104346.27167-1-lukasz.luba@arm.com>

Add mechanism to discover the power scale present in the performance
protocol for all domains. Provide this information to Energy Model,
which then can be checked in other frameworks, e.g. thermal.

Suggested-by: Morten Rasmussen <morten.rasmussen@arm.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
 drivers/cpufreq/scmi-cpufreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index dfd87752f054..491a0a24fb1e 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -126,6 +126,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 	struct scmi_data *priv;
 	struct cpufreq_frequency_table *freq_table;
 	struct em_data_callback em_cb = EM_DATA_CB(scmi_get_cpu_power);
+	bool power_scale_mw;
 
 	cpu_dev = get_cpu_device(policy->cpu);
 	if (!cpu_dev) {
@@ -189,8 +190,9 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible =
 		handle->perf_ops->fast_switch_possible(handle, cpu_dev);
 
+	power_scale_mw = handle->perf_ops->power_scale_mw_get(handle);
 	em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
-				    false);
+				    power_scale_mw);
 
 	return 0;
 
-- 
2.17.1


  parent reply	other threads:[~2020-11-24 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 10:43 [PATCH 0/2] SCMI performance protocol power scale interface Lukasz Luba
2020-11-24 10:43 ` [PATCH 1/2] firmware: arm_scmi: Add power_scale_mw_get() interface Lukasz Luba
2020-11-24 16:56   ` Sudeep Holla
2020-11-25  9:18     ` Lukasz Luba
2020-11-24 10:43 ` Lukasz Luba [this message]
2020-11-25  9:29 ` [PATCH 0/2] SCMI performance protocol power scale interface Lukasz Luba
2020-12-07  7:13 ` Viresh Kumar
2020-12-08  4:48   ` Viresh Kumar
2020-12-08  8:36     ` Lukasz Luba

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=20201124104346.27167-3-lukasz.luba@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=Dietmar.Eggemann@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    /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