All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	shawn.guo@linaro.org, sboyd@codeaurora.org,
	linux-arm-msm@vger.kernel.org, spk.linux@gmail.com,
	thomas.ab@samsung.com, t.figa@samsung.com,
	santosh.shilimkar@ti.com, thomas.petazzoni@free-electrons.com,
	pramod.gurav@smartplayin.com, rob.herring@linaro.org,
	mike.turquette@linaro.org, Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] cpufreq: dt: Support platforms with separate clock lines for each CPU
Date: Wed, 10 Sep 2014 09:59:07 +0530	[thread overview]
Message-ID: <fcb88cd21f31a467d2d49911c2505082837f72ea.1410323179.git.viresh.kumar@linaro.org> (raw)

There has been lots of discussion over mailing lists about how to get CPU's
clock sharing information for platforms as CPUFreq core depends on that. It
doesn't look that there will be any immediate solution to that as there are
multiple views over how to get that from DT.

But there are platforms (already upstreamed) which depend on this requirement
and are waiting for a solution to sail through.

The common thing about them (Krait and Mvebu) is that all CPUs have independent
clock lines and that makes things easier for us.

So, this patch creates another Kconfig option to indicate if all CPUs share same
clock line or all have independent. The complex cases of multiple clusters
having separate clock lines, but having same for all CPUs within a cluster isn't
addressed yet.

This is a *short-term* solution for getting these platforms up an running and a
DT based solution should be upstreamed soon.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Yesterday again I was pinged by Thomas about the status of this work and the
thread isn't going anywhere. He is blocked with just this to get his platform
running on mainline.

Will it be possible to get this through as a temporary solution?

 drivers/cpufreq/Kconfig      |  9 +++++++++
 drivers/cpufreq/cpufreq-dt.c | 17 +++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 3489f8f..a755227 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -196,6 +196,15 @@ config CPUFREQ_DT
 
 	  If in doubt, say N.
 
+config CPUFREQ_DT_INDEPENDENT_CLOCKS
+	bool "CPUs change clocks independently"
+	depends on CPUFREQ_DT
+	help
+	  Selecting this will make cpufreq-dt driver believe that all CPUs have
+	  independent clock lines and so all will have separate 'struct
+	  cpufreq_policy' instances for them. This must be replaced by proper DT
+	  bindings later on.
+
 menu "x86 CPU frequency scaling drivers"
 depends on X86
 source "drivers/cpufreq/Kconfig.x86"
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index e002650..dbb6f22 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -266,9 +266,22 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	policy->driver_data = priv;
 
 	policy->clk = cpu_clk;
-	ret = cpufreq_generic_init(policy, freq_table, transition_latency);
-	if (ret)
+	ret = cpufreq_table_validate_and_show(policy, freq_table);
+	if (ret) {
+		dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
+			ret);
 		goto out_cooling_unregister;
+	}
+
+	policy->cpuinfo.transition_latency = transition_latency;
+
+#ifndef CONFIG_CPUFREQ_DT_INDEPENDENT_CLOCKS
+	/*
+	 * The driver only supports the SMP configuartion where all processors
+	 * share the clock and voltage and clock.
+	 */
+	cpumask_setall(policy->cpus);
+#endif
 
 	return 0;
 
-- 
2.0.3.693.g996b0fd

             reply	other threads:[~2014-09-10  4:29 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  4:29 Viresh Kumar [this message]
2014-09-10  6:29 ` [PATCH] cpufreq: dt: Support platforms with separate clock lines for each CPU Thomas Petazzoni
2014-09-10  6:42   ` Viresh Kumar
2014-09-10  9:41     ` [PATCH 0/4] cpufreq-dt, platform_data based proposal Thomas Petazzoni
2014-09-10  9:41       ` [PATCH 1/4] cpufreq: allow driver-specific flags Thomas Petazzoni
2014-09-10 10:49         ` Viresh Kumar
2014-09-27 22:44           ` Mike Turquette
2014-09-29  8:54             ` Viresh Kumar
     [not found]               ` <20141005004102.4379.42626@quantum>
2014-10-06  3:56                 ` Viresh Kumar
     [not found]                   ` <20141006183624.4379.26437@quantum>
2014-10-06 18:55                     ` Thomas Petazzoni
2014-10-06 21:44                       ` Mike Turquette
2014-10-07  3:27                         ` Viresh Kumar
2014-10-07  3:25                     ` Viresh Kumar
2014-10-08  7:48                       ` [PATCH 0/2] allow cpufreq drivers to export flags Mike Turquette
2014-10-08  7:48                         ` [PATCH 1/2] cpufreq: add driver flag for sleepable transitions Mike Turquette
2014-10-08  7:48                         ` [PATCH 2/2] cpufreq: new function to query driver for flags Mike Turquette
2014-10-08  7:54                         ` [PATCH 0/2] allow cpufreq drivers to export flags Viresh Kumar
2014-10-08  7:54                           ` Viresh Kumar
2014-10-08  8:11                           ` Thomas Petazzoni
2014-10-08  8:11                             ` Thomas Petazzoni
2014-10-08  8:19                             ` Viresh Kumar
2014-10-08  8:19                               ` Viresh Kumar
2014-10-09  0:01                               ` Mike Turquette
2014-10-09  0:01                                 ` Mike Turquette
2014-10-09  3:37                                 ` Viresh Kumar
2014-10-09  3:37                                   ` Viresh Kumar
2014-09-10  9:41       ` [PATCH 2/4] cpufreq: cpufreq-dt: extend with platform_data Thomas Petazzoni
2014-09-10  9:41       ` [PATCH 3/4] ARM: mvebu: use the cpufreq-dt platform_data for independent clocks Thomas Petazzoni
2014-09-10  9:41       ` [PATCH 4/4] cpufreq: cpufreq-dt: remove warning about regulators Thomas Petazzoni
2014-09-10 10:30         ` Viresh Kumar
2014-09-10  9:53       ` [PATCH 0/4] cpufreq-dt, platform_data based proposal Arnd Bergmann
2014-09-10 10:10         ` Thomas Petazzoni
2014-09-10 10:19           ` Arnd Bergmann
2014-09-10 10:30             ` Thomas Petazzoni
2014-09-10 18:15         ` Stephen Boyd
2014-09-10 10:38       ` Viresh Kumar
2014-09-10 11:37         ` Thomas Petazzoni
2014-09-10 12:08     ` [PATCHv2 " Thomas Petazzoni
2014-09-10 12:08       ` [PATCHv2 1/4] cpufreq: allow driver-specific data Thomas Petazzoni
2014-09-10 12:08       ` [PATCHv2 2/4] cpufreq: cpufreq-dt: extend with platform_data Thomas Petazzoni
2014-09-10 12:22         ` Viresh Kumar
2014-09-10 12:28           ` Thomas Petazzoni
2014-09-10 12:32             ` Viresh Kumar
2014-09-10 12:36               ` Arnd Bergmann
2014-09-10 12:08       ` [PATCHv2 3/4] ARM: mvebu: use the cpufreq-dt platform_data for independent clocks Thomas Petazzoni
2014-09-10 12:08       ` [PATCHv2 4/4] cpufreq: cpufreq-dt: adjust message related to regulators Thomas Petazzoni
2014-09-10 12:23         ` Viresh Kumar
2014-09-10 12:38       ` [PATCHv2 0/4] cpufreq-dt, platform_data based proposal Viresh Kumar
2014-09-23  9:26       ` Thomas Petazzoni
2014-10-06  7:19       ` Thomas Petazzoni
2014-10-06 22:53         ` Rafael J. Wysocki
2014-10-07  3:30           ` Viresh Kumar
2014-10-07 23:59             ` Rafael J. Wysocki
2014-10-08  5:51               ` Viresh Kumar
2014-10-12 20:25                 ` Rafael J. Wysocki
2014-10-19  9:31                   ` Thomas Petazzoni

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=fcb88cd21f31a467d2d49911c2505082837f72ea.1410323179.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mike.turquette@linaro.org \
    --cc=pramod.gurav@smartplayin.com \
    --cc=rjw@rjwysocki.net \
    --cc=rob.herring@linaro.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=shawn.guo@linaro.org \
    --cc=spk.linux@gmail.com \
    --cc=t.figa@samsung.com \
    --cc=thomas.ab@samsung.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.