linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicola Mazzucato <nicola.mazzucato@arm.com>
To: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
	sudeep.holla@arm.com, rjw@rjwysocki.net, vireshk@kernel.org,
	cristian.marussi@arm.com
Cc: morten.rasmussen@arm.com, chris.redpath@arm.com,
	nicola.mazzucato@arm.com
Subject: [PATCH v6 1/4] scmi-cpufreq: Remove deferred probe
Date: Mon, 11 Jan 2021 15:45:21 +0000	[thread overview]
Message-ID: <20210111154524.20196-2-nicola.mazzucato@arm.com> (raw)
In-Reply-To: <20210111154524.20196-1-nicola.mazzucato@arm.com>

The current implementation still carries a case for a deferred probe, but
in practise this should not happen anymore.

Since the energy model expects to pass the number of OPPs, let us just
move the call dev_pm_opp_get_opp_count closer to EM registration instead.

Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
---
 drivers/cpufreq/scmi-cpufreq.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index 491a0a24fb1e..15b213ed78fa 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -153,13 +153,6 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
-	if (nr_opp <= 0) {
-		dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n");
-		ret = -EPROBE_DEFER;
-		goto out_free_opp;
-	}
-
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	if (!priv) {
 		ret = -ENOMEM;
@@ -190,6 +183,15 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible =
 		handle->perf_ops->fast_switch_possible(handle, cpu_dev);
 
+	nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
+	if (nr_opp <= 0) {
+		dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
+			__func__, ret);
+
+		ret = -ENODEV;
+		goto out_free_priv;
+	}
+
 	power_scale_mw = handle->perf_ops->power_scale_mw_get(handle);
 	em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
 				    power_scale_mw);
-- 
2.27.0


  reply	other threads:[~2021-01-11 15:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 15:45 [PATCH v6 0/4] CPUFreq: Add support for opp-sharing cpus Nicola Mazzucato
2021-01-11 15:45 ` Nicola Mazzucato [this message]
2021-01-11 15:45 ` [PATCH v6 2/4] scmi-cpufreq: Move CPU initialisation to probe Nicola Mazzucato
2021-01-12 11:17   ` Viresh Kumar
2021-01-13 11:55     ` Nicola Mazzucato
2021-01-14  5:07       ` Viresh Kumar
2021-01-14 13:37         ` Nicola Mazzucato
2021-01-14 16:54   ` Cristian Marussi
2021-01-30  9:43     ` Nicola Mazzucato
2021-01-11 15:45 ` [PATCH v6 3/4] scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM Nicola Mazzucato
2021-01-12 11:20   ` Viresh Kumar
2021-01-13 12:00     ` Nicola Mazzucato
2021-01-11 15:45 ` [PATCH v6 4/4] cpufreq: blacklist Arm Vexpress platforms in cpufreq-dt-platdev Nicola Mazzucato

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=20210111154524.20196-2-nicola.mazzucato@arm.com \
    --to=nicola.mazzucato@arm.com \
    --cc=chris.redpath@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=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=vireshk@kernel.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;
as well as URLs for NNTP newsgroup(s).