Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1217437
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Viresh Kumar <viresh.kumar@linaro.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] cpufreq: dt: Check OPP count before marking them shared |
| Date | Wed, 02 Sep 2015 11:10:03 +0200 |
| Message-ID | <q4cdl-zo-41@gated-at.bofh.it> (permalink) |
| References | <q4cdj-zo-5@gated-at.bofh.it> |
| X-Original-To | Rafael Wysocki <rjw@rjwysocki.net> |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=R0HfwMTOVX8jxis1al9WTrk4ZivXB2QczxzzISjCpuY=; b=TTv05emVNK8eKwoHXpMhH2GaGTb0Kqb98TkkqVsfRFrZ1d2pgTb8nMnis0GNVIo9oB iM7tuQrkn/1tnmLEVjbf2PmNEfym4Q3x4MRweqZJEqSXTQ3IRsgEGjXdsJgTTtrDDw9Z ElCTvBAr6bz3VK2JS/CUj3vLGYs57mJjpkFuhaft5cVrFe20H2UqrV4CUXmtM540DJi9 UK05Tk1SOFU8Bs0/FIjXUE/5Ms1bhZYl5BTWJO1AE3SHyBRagw96xt1iXUm52q+99py/ +vo7OUX2dJP1yXT7ksTa6u4mBglByNgnR7MXOBhsTiV01Z4qolRfiUyurl1EKwmWBZ6o 6yTg== |
| X-Gm-Message-State | ALoCoQkYjIq63qgxvHVSND88mmBzgoJMzJZy34HXzaOEYLEFcg5ovzAtBIlvEcLsfhx5O5mxpadt |
| X-Received | by 10.66.193.132 with SMTP id ho4mr54972603pac.154.1441184824812; Wed, 02 Sep 2015 02:07:04 -0700 (PDT) |
| X-Mailer | git-send-email 2.4.0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 60 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar <viresh.kumar@linaro.org>, linux-kernel@vger.kernel.org (open list) |
| X-Original-Date | Wed, 2 Sep 2015 14:36:48 +0530 |
| X-Original-Message-ID | <e0d14cbedb773c0f18fa9b1380e3e3ccd78bbb4c.1441184706.git.viresh.kumar@linaro.org> |
| X-Original-References | <cover.1441184706.git.viresh.kumar@linaro.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1217437 |
Show key headers only | View raw
We need to explicitly mark OPPs as shared, when they are not defined
with OPP-v2 bindings. But this isn't required to be done if we failed to
initialize OPP table.
Reorder code to verify OPP count before marking them shared.
Fixes: 2e02d8723edf ("cpufreq: dt: Add support for operating-points-v2 bindings")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq-dt.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index c3583cdfadbd..8c38b5192baa 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -239,6 +239,17 @@ static int cpufreq_init(struct cpufreq_policy *policy)
*/
of_cpumask_init_opp_table(policy->cpus);
+ /*
+ * But we need OPP table to function so if it is not there let's
+ * give platform code chance to provide it for us.
+ */
+ ret = dev_pm_opp_get_opp_count(cpu_dev);
+ if (ret <= 0) {
+ pr_debug("OPP table is not ready, deferring probe\n");
+ ret = -EPROBE_DEFER;
+ goto out_free_opp;
+ }
+
if (need_update) {
struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data();
@@ -256,17 +267,6 @@ static int cpufreq_init(struct cpufreq_policy *policy)
transition_latency = dev_pm_opp_get_max_clock_latency(cpu_dev);
}
- /*
- * But we need OPP table to function so if it is not there let's
- * give platform code chance to provide it for us.
- */
- ret = dev_pm_opp_get_opp_count(cpu_dev);
- if (ret <= 0) {
- pr_debug("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;
--
2.4.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 1/3] cpufreq: dt: Check OPP count before marking them shared Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-02 11:10 +0200
csiph-web