linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@sisk.pl
Cc: linaro-kernel@lists.linaro.org, patches@linaro.org,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 35/37] cpufreq: speedstep: don't initialize part of policy that is set by core too
Date: Wed, 14 Aug 2013 19:02:24 +0530	[thread overview]
Message-ID: <52ec8dfc91702bada1c0b3367b264624fc1df042.1376486714.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1376486713.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1376486713.git.viresh.kumar@linaro.org>

Many common initializations of struct policy are moved to core now and hence
this driver doesn't need to do it. This patch removes such code.

Most recent of those changes is to call ->get() in the core after calling
->init().

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/speedstep-centrino.c |  5 -----
 drivers/cpufreq/speedstep-ich.c      | 15 +--------------
 drivers/cpufreq/speedstep-smi.c      | 13 -------------
 3 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
index b309774..b7a2f8d 100644
--- a/drivers/cpufreq/speedstep-centrino.c
+++ b/drivers/cpufreq/speedstep-centrino.c
@@ -343,7 +343,6 @@ static unsigned int get_cur_freq(unsigned int cpu)
 static int centrino_cpu_init(struct cpufreq_policy *policy)
 {
 	struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
-	unsigned freq;
 	unsigned l, h;
 	int i;
 
@@ -394,12 +393,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
 		}
 	}
 
-	freq = get_cur_freq(policy->cpu);
 	policy->cpuinfo.transition_latency = 10000;
 						/* 10uS transition latency */
-	policy->cur = freq;
-
-	pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
 
 	return cpufreq_table_validate_and_show(policy,
 		per_cpu(centrino_model, policy->cpu)->op_points);
diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c
index be63486..707721e 100644
--- a/drivers/cpufreq/speedstep-ich.c
+++ b/drivers/cpufreq/speedstep-ich.c
@@ -296,7 +296,7 @@ static void get_freqs_on_cpu(void *_get_freqs)
 
 static int speedstep_cpu_init(struct cpufreq_policy *policy)
 {
-	unsigned int policy_cpu, speed;
+	unsigned int policy_cpu;
 	struct get_freqs gf;
 
 	/* only run on CPU to be set, or on its sibling */
@@ -311,19 +311,6 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 	if (gf.ret)
 		return gf.ret;
 
-	/* get current speed setting */
-	speed = speedstep_get(policy_cpu);
-	if (!speed)
-		return -EIO;
-
-	pr_debug("currently at %s speed setting - %i MHz\n",
-		(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
-		? "low" : "high",
-		(speed / 1000));
-
-	/* cpuinfo and default policy values */
-	policy->cur = speed;
-
 	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
 }
 
diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c
index 878e64b..19446e4 100644
--- a/drivers/cpufreq/speedstep-smi.c
+++ b/drivers/cpufreq/speedstep-smi.c
@@ -257,7 +257,6 @@ static int speedstep_target(struct cpufreq_policy *policy, unsigned int index)
 static int speedstep_cpu_init(struct cpufreq_policy *policy)
 {
 	int result;
-	unsigned int speed, state;
 	unsigned int *low, *high;
 
 	/* capability check */
@@ -293,19 +292,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 			pr_debug("workaround worked.\n");
 	}
 
-	/* get current speed setting */
-	state = speedstep_get_state();
-	speed = speedstep_freqs[state].frequency;
-
-	pr_debug("currently at %s speed setting - %i MHz\n",
-		(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
-		? "low" : "high",
-		(speed / 1000));
-
-	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	policy->cur = speed;
-
 	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
 }
 
-- 
1.7.12.rc2.18.g61b472e


  parent reply	other threads:[~2013-08-14 13:37 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 13:31 [PATCH 00/37] CPUFreq: set policy->cur in cpufreq core instead of Viresh Kumar
2013-08-14 13:31 ` [PATCH 01/37] cpufreq: call cpufreq_driver->get() after calling ->init() Viresh Kumar
2013-08-14 13:31 ` [PATCH 02/37] cpufreq: acpi: don't initialize part of policy that is set by core too Viresh Kumar
2013-08-14 13:31 ` [PATCH 03/37] cpufreq: arm_big_little: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 04/37] cpufreq: at32ap: " Viresh Kumar
2013-08-14 14:35   ` Hans-Christian Egtvedt
2013-08-14 14:37     ` Viresh Kumar
2013-08-14 14:44       ` Hans-Christian Egtvedt
2013-08-14 13:31 ` [PATCH 05/37] cpufreq: blackfin: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 06/37] cpufreq: cpu0: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 07/37] cpufreq: nforce2: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 08/37] cpufreq: cris: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 09/37] cpufreq: davinci: " Viresh Kumar
2013-08-14 13:31 ` [PATCH 10/37] cpufreq: dbx500: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 11/37] cpufreq: e_powersaver: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 12/37] cpufreq: elanfreq: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 13/37] cpufreq: exynos: " Viresh Kumar
2013-08-18 10:50   ` amit daniel kachhap
2013-08-18 21:58     ` Kukjin Kim
2013-08-14 13:32 ` [PATCH 14/37] cpufreq: gx: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 15/37] cpufreq: ia64-acpi: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 16/37] cpufreq: imx6q: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 17/37] cpufreq: integrator: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 18/37] cpufreq: kirkwood: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 19/37] cpufreq: longhaul: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 20/37] cpufreq: loongson2: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 21/37] cpufreq: maple: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 22/37] cpufreq: omap: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 23/37] cpufreq: p4: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 24/37] cpufreq: pcc: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 25/37] cpufreq: pmac: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 26/37] cpufreq: powernow: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 27/37] cpufreq: ppc: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 28/37] cpufreq: pxa: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 29/37] cpufreq: s3c: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 30/37] cpufreq: s5pv210: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 31/37] cpufreq: sa11x0: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 32/37] cpufreq: sc520_freq: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 33/37] cpufreq: sh: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 34/37] cpufreq: spear: " Viresh Kumar
2013-08-14 13:32 ` Viresh Kumar [this message]
2013-08-14 13:32 ` [PATCH 36/37] cpufreq: tegra: " Viresh Kumar
2013-08-14 13:32 ` [PATCH 37/37] cpufreq: unicore2: " Viresh Kumar

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=52ec8dfc91702bada1c0b3367b264624fc1df042.1376486714.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    /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).