Skip to contentSkip to conversation

CPUFreq: set policy->cur in cpufreq core instead of

PATCH In review Viresh Kumar 4 participants 43 messages Aug 14, 2013 – Aug 18, 2013

Subsystems (7)
lore
Share & tools
lore

Viresh Kumar

author maintainer
#0 lore raw

cover CPUFreq: set policy->cur in cpufreq core instead of

Almost all drivers set policy->cur with current cpu frequency in their ->init() part. This can be done for all of them at core level and so they wouldn't need to do it.

This patchset adds supporting code in cpufreq core for calling get() after we have called init() for a policy. Also fixes all drivers accordingly.

These drivers were still doing some stuff which isn't required and was done by core already. And that is cleaned as well.

This is Fourth part of my cleanup work for CPUFreq, first three are (And obviously its rebased over them):

1: cpufreq: Introduce cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263

2: cpufreq: define generic routines for cpufreq drivers
https://lkml.org/lkml/2013/8/10/48

3. CPUFreq: Implement light weight ->target(): for 3.13
https://lkml.org/lkml/2013/8/13/349

All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/for-v3.13

--
viresh

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc Eric Miao <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc John Crispin <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mikael Starvik <[email protected]>
Cc Paul Mundt <[email protected]>
Cc Russell King <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Steven Miao <[email protected]>
Cc Tony Luck <[email protected]>

Viresh Kumar (37):
cpufreq: call cpufreq_driver->get() after calling ->init()
cpufreq: acpi: don't initialize part of policy that is set by core
too
cpufreq: arm_big_little: don't initialize part of policy that is set
by core too
cpufreq: at32ap: don't initialize part of policy that is set by core
too
cpufreq: blackfin: don't initialize part of policy that is set by
core too
cpufreq: cpu0: don't initialize part of policy that is set by core
too
cpufreq: nforce2: don't initialize part of policy that is set by core
too
cpufreq: cris: don't initialize part of policy that is set by core
too
cpufreq: davinci: don't initialize part of policy that is set by core
too
cpufreq: dbx500: don't initialize part of policy that is set by core
too
cpufreq: e_powersaver: don't initialize part of policy that is set by
core too
cpufreq: elanfreq: don't initialize part of policy that is set by
core too
cpufreq: exynos: don't initialize part of policy that is set by core
too
cpufreq: gx: don't initialize part of policy that is set by core too
cpufreq: ia64-acpi: don't initialize part of policy that is set by
core too
cpufreq: imx6q: don't initialize part of policy that is set by core
too
cpufreq: integrator: don't initialize part of policy that is set by
core too
cpufreq: kirkwood: don't initialize part of policy that is set by
core too
cpufreq: longhaul: don't initialize part of policy that is set by
core too
cpufreq: loongson2: don't initialize part of policy that is set by
core too
cpufreq: maple: don't initialize part of policy that is set by core
too
cpufreq: omap: don't initialize part of policy that is set by core
too
cpufreq: p4: don't initialize part of policy that is set by core too
cpufreq: pcc: don't initialize part of policy that is set by core too
cpufreq: pmac: don't initialize part of policy that is set by core
too
cpufreq: powernow: don't initialize part of policy that is set by
core too
cpufreq: ppc: don't initialize part of policy that is set by core too
cpufreq: pxa: don't initialize part of policy that is set by core too
cpufreq: s3c: don't initialize part of policy that is set by core too
cpufreq: s5pv210: don't initialize part of policy that is set by core
too
cpufreq: sa11x0: don't initialize part of policy that is set by core
too
cpufreq: sc520_freq: don't initialize part of policy that is set by
core too
cpufreq: sh: don't initialize part of policy that is set by core too
cpufreq: spear: don't initialize part of policy that is set by core
too
cpufreq: speedstep: don't initialize part of policy that is set by
core too
cpufreq: tegra: don't initialize part of policy that is set by core
too
cpufreq: unicore2: don't initialize part of policy that is set by
core too

 drivers/cpufreq/acpi-cpufreq.c         |  1 -
 drivers/cpufreq/arm_big_little.c       |  2 --
 drivers/cpufreq/at32ap-cpufreq.c       | 12 ++++--------
 drivers/cpufreq/blackfin-cpufreq.c     |  1 -
 drivers/cpufreq/cpufreq-cpu0.c         |  1 -
 drivers/cpufreq/cpufreq-nforce2.c      |  1 -
 drivers/cpufreq/cpufreq.c              | 11 +++++++++++
 drivers/cpufreq/cris-artpec3-cpufreq.c |  1 -
 drivers/cpufreq/cris-etraxfs-cpufreq.c |  1 -
 drivers/cpufreq/davinci-cpufreq.c      |  2 --
 drivers/cpufreq/dbx500-cpufreq.c       |  5 -----
 drivers/cpufreq/e_powersaver.c         |  1 -
 drivers/cpufreq/elanfreq.c             |  1 -
 drivers/cpufreq/exynos-cpufreq.c       |  2 --
 drivers/cpufreq/exynos5440-cpufreq.c   |  1 -
 drivers/cpufreq/gx-suspmod.c           |  5 +----
 drivers/cpufreq/ia64-acpi-cpufreq.c    |  1 -
 drivers/cpufreq/imx6q-cpufreq.c        |  1 -
 drivers/cpufreq/integrator-cpufreq.c   |  5 ++---
 drivers/cpufreq/kirkwood-cpufreq.c     |  1 -
 drivers/cpufreq/longhaul.c             |  1 -
 drivers/cpufreq/loongson2_cpufreq.c    |  2 --
 drivers/cpufreq/maple-cpufreq.c        |  1 -
 drivers/cpufreq/omap-cpufreq.c         |  4 ----
 drivers/cpufreq/p4-clockmod.c          |  1 -
 drivers/cpufreq/pcc-cpufreq.c          |  7 -------
 drivers/cpufreq/pmac32-cpufreq.c       |  1 -
 drivers/cpufreq/pmac64-cpufreq.c       |  1 -
 drivers/cpufreq/powernow-k6.c          |  1 -
 drivers/cpufreq/powernow-k7.c          |  2 --
 drivers/cpufreq/powernow-k8.c          |  3 ---
 drivers/cpufreq/ppc-corenet-cpufreq.c  |  2 --
 drivers/cpufreq/pxa2xx-cpufreq.c       |  2 --
 drivers/cpufreq/pxa3xx-cpufreq.c       |  7 +++----
 drivers/cpufreq/s3c2416-cpufreq.c      |  2 --
 drivers/cpufreq/s3c24xx-cpufreq.c      |  5 -----
 drivers/cpufreq/s3c64xx-cpufreq.c      |  2 --
 drivers/cpufreq/s5pv210-cpufreq.c      |  2 --
 drivers/cpufreq/sa1100-cpufreq.c       |  1 -
 drivers/cpufreq/sa1110-cpufreq.c       |  1 -
 drivers/cpufreq/sc520_freq.c           |  1 -
 drivers/cpufreq/sh-cpufreq.c           |  2 --
 drivers/cpufreq/spear-cpufreq.c        |  2 --
 drivers/cpufreq/speedstep-centrino.c   |  5 -----
 drivers/cpufreq/speedstep-ich.c        | 15 +--------------
 drivers/cpufreq/speedstep-smi.c        | 13 -------------
 drivers/cpufreq/tegra-cpufreq.c        |  3 +--
 drivers/cpufreq/unicore2-cpufreq.c     |  1 -
 48 files changed, 23 insertions(+), 123 deletions(-)
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#1 lore raw

PATCH 1/37 cpufreq: call cpufreq_driver->get() after calling ->init()

Almost all drivers set policy->cur with current cpu frequency in their ->init() part. This can be done for all of them at core level and so they wouldn't need to do it.

This patch adds supporting code in cpufreq core for calling get() after we have called init() for a policy.

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc Eric Miao <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc John Crispin <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mikael Starvik <[email protected]>
Cc Paul Mundt <[email protected]>
Cc Russell King <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Steven Miao <[email protected]>
Cc Tony Luck <[email protected]>
---
 drivers/cpufreq/cpufreq.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/cpufreq/cpufreq.c +11 -0
index 4d37306..a7a1d3e 100644
@@ -1038,6 +1038,14 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
 		goto err_set_policy_cpu;
 	}
 
+	if (cpufreq_driver->get) {
+		policy->cur = cpufreq_driver->get(policy->cpu);
+		if (!policy->cur) {
+			pr_err("%s: ->get() failed\n", __func__);
+			goto err_get_freq;
+		}
+	}
+
 	/* related cpus should atleast have policy->cpus */
 	cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
 
@@ -1097,6 +1105,9 @@ err_out_unregister:
 	}
 	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
+err_get_freq:
+	if (cpufreq_driver->exit)
+		cpufreq_driver->exit(policy);
 err_set_policy_cpu:
 	per_cpu(cpufreq_policy_cpu, cpu) = -1;
 	cpufreq_policy_free(policy);
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#2 lore raw

PATCH 2/37 cpufreq: acpi: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/acpi-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/acpi-cpufreq.c +0 -1
index 324e061..7536e7d 100644
@@ -833,7 +833,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		break;
 	case ACPI_ADR_SPACE_FIXED_HARDWARE:
 		acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
-		policy->cur = get_cur_freq_on_cpu(cpu);
 		break;
 	default:
 		break;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#3 lore raw

PATCH 3/37 cpufreq: arm_big_little: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/arm_big_little.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/arm_big_little.c +0 -2
index 4bba5ad..daf4423 100644
@@ -164,8 +164,6 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
 	else
 		policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
-	policy->cur = bL_cpufreq_get(policy->cpu);
-
 	cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu));
 
 	dev_info(cpu_dev, "%s: CPU %d initialized\n", __func__, policy->cpu);
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#4 lore raw

PATCH 4/37 cpufreq: at32ap: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 Hans-Christian Egtvedt <[email protected]>
---
 drivers/cpufreq/at32ap-cpufreq.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/cpufreq/at32ap-cpufreq.c +4 -8
index bae6ed8..81d0752 100644
@@ -64,7 +64,7 @@ static int at32_set_target(struct cpufreq_policy *policy, unsigned int index)
 
 static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 {
-	unsigned int frequency, rate;
+	unsigned int frequency, rate, min_freq;
 	int retval, steps, i;
 
 	if (policy->cpu != 0)
@@ -77,12 +77,9 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 		goto out_err;
 	}
 
-	policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000;
-	policy->cpuinfo.max_freq = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
+	min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000;
+	frequency = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
 	policy->cpuinfo.transition_latency = 0;
-	policy->cur = at32_get_speed(0);
-	policy->min = policy->cpuinfo.min_freq;
-	policy->max = policy->cpuinfo.max_freq;
 
 	/*
 	 * AVR32 CPU frequency rate scales in power of two between maximum and
@@ -91,7 +88,7 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 	 * Further validate that the frequency is usable, and append it to the
 	 * frequency table.
 	 */
-	steps = fls(policy->cpuinfo.max_freq / policy->cpuinfo.min_freq) + 1;
+	steps = fls(frequency / min_freq) + 1;
 	freq_table = kzalloc(steps * sizeof(struct cpufreq_frequency_table),
 			GFP_KERNEL);
 	if (!freq_table) {
@@ -99,7 +96,6 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 		goto out_err_put_clk;
 	}
 
-	frequency = policy->cpuinfo.max_freq;
 	for (i = 0; i < (steps - 1); i++) {
 		rate = clk_round_rate(cpuclk, frequency * 1000) / 1000;
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 4/37
#5 lore raw

Re: [PATCH 04/37] cpufreq: at32ap: don't initialize part of policy that is set by core too

Quoted 5 lines · Viresh Kumar

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().

It would be easier to review if you add me to CC on the new APIs you implement as well. Now I had to look up what the ->get() call did.

Quoted 5 lines
Cc Hans-Christian Egtvedt <[email protected]>
---
 drivers/cpufreq/at32ap-cpufreq.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Assuming the core get() call replaces the content:

Signature · 2 lines
mvh
Hans-Christian Egtvedt
author maintainer
#6 lore raw

Re: [PATCH 04/37] cpufreq: at32ap: don't initialize part of policy that is set by core too

Quoted 9 lines · Hans-Christian Egtvedt
Quoted 5 lines · Viresh Kumar

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().

It would be easier to review if you add me to CC on the new APIs you implement as well. Now I had to look up what the ->get() call did.

I know my track record hasn't been impressive on this subject but I am sure I am following this since sometime now :)

https://lkml.org/lkml/2013/8/14/285

#7 lore raw

Re: [PATCH 04/37] cpufreq: at32ap: don't initialize part of policy that is set by core too

Quoted 8 lines · Viresh Kumar
Quoted 7 lines · Hans-Christian Egtvedt
Quoted 5 lines · Viresh Kumar

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().

Quoted 7 lines
Quoted 2 lines

It would be easier to review if you add me to CC on the new APIs you implement as well. Now I had to look up what the ->get() call did.

I know my track record hasn't been impressive on this subject but I am sure I am following this since sometime now :)

https://lkml.org/lkml/2013/8/14/285

Sorry, my bad, I actually had gotten it, it was just so too short to notice.

Signature · 2 lines
mvh
Hans-Christian Egtvedt
author maintainer
#8 lore raw

PATCH 5/37 cpufreq: blackfin: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/blackfin-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/blackfin-cpufreq.c +0 -1
index b343c7b..12528b2 100644
@@ -195,7 +195,6 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy)
 
 	policy->cpuinfo.transition_latency = 50000; /* 50us assumed */
 
-	policy->cur = cclk;
 	return cpufreq_table_validate_and_show(policy, bfin_freq_table);
 }
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#9 lore raw

PATCH 6/37 cpufreq: cpu0: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/cpufreq-cpu0.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/cpufreq-cpu0.c +0 -1
index 000da22..4014925 100644
@@ -117,7 +117,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	policy->cpuinfo.transition_latency = transition_latency;
-	policy->cur = clk_get_rate(cpu_clk) / 1000;
 
 	/*
 	 * The driver only supports the SMP configuartion where all processors
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#10 lore raw

PATCH 7/37 cpufreq: nforce2: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/cpufreq-nforce2.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/cpufreq-nforce2.c +0 -1
index b83d45f..ef70de2 100644
@@ -362,7 +362,6 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
 	policy->min = policy->cpuinfo.min_freq = min_fsb * fid * 100;
 	policy->max = policy->cpuinfo.max_freq = max_fsb * fid * 100;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	policy->cur = nforce2_get(policy->cpu);
 
 	return 0;
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#11 lore raw

PATCH 8/37 cpufreq: cris: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/cris-artpec3-cpufreq.c | 1 -
 drivers/cpufreq/cris-etraxfs-cpufreq.c | 1 -
 2 files changed, 2 deletions(-)
drivers/cpufreq/cris-artpec3-cpufreq.c +0 -1
index 1488277..dace19d 100644
@@ -59,7 +59,6 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy)
 {
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 1000000; /* 1ms */
-	policy->cur = cris_freq_get_cpu_frequency(0);
 
 	return cpufreq_table_validate_and_show(policy, cris_freq_table);
 }
drivers/cpufreq/cris-etraxfs-cpufreq.c +0 -1
index 4e3e9c7..4d40d9df 100644
@@ -59,7 +59,6 @@ static int cris_freq_cpu_init(struct cpufreq_policy *policy)
 {
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 1000000;	/* 1ms */
-	policy->cur = cris_freq_get_cpu_frequency(0);
 
 	return cpufreq_table_validate_and_show(policy, cris_freq_table);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#12 lore raw

PATCH 9/37 cpufreq: davinci: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/davinci-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/davinci-cpufreq.c +0 -2
index 822100b..07ea6c0 100644
@@ -128,8 +128,6 @@ static int davinci_cpu_init(struct cpufreq_policy *policy)
 			return result;
 	}
 
-	policy->cur = davinci_getspeed(0);
-
 	result = cpufreq_table_validate_and_show(policy, freq_table);
 	if (result) {
 		pr_err("%s: cpufreq_table_validate_and_show() failed",
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#13 lore raw

PATCH 10/37 cpufreq: dbx500: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/dbx500-cpufreq.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpufreq/dbx500-cpufreq.c +0 -5
index 28deaf0..d6d6b8c 100644
@@ -73,11 +73,6 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy)
 		return res;
 	}
 
-	policy->min = policy->cpuinfo.min_freq;
-	policy->max = policy->cpuinfo.max_freq;
-	policy->cur = dbx500_cpufreq_getspeed(policy->cpu);
-	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
-
 	/*
 	 * FIXME : Need to take time measurement across the target()
 	 *	   function with no/some/all drivers in the notification
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#14 lore raw

PATCH 11/37 cpufreq: e_powersaver: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/e_powersaver.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/e_powersaver.c +0 -1
index 60cd576..b39c4ef 100644
@@ -384,7 +384,6 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
 	}
 
 	policy->cpuinfo.transition_latency = 140000; /* 844mV -> 700mV in ns */
-	policy->cur = fsb * current_multiplier;
 
 	ret = cpufreq_table_validate_and_show(policy, &centaur->freq_table[0]);
 	if (ret) {
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#15 lore raw

PATCH 12/37 cpufreq: elanfreq: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/elanfreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/elanfreq.c +0 -1
index 0d133a7..4ab4153 100644
@@ -179,7 +179,6 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
 
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	policy->cur = elanfreq_get_cpu_frequency(0);
 
 	return cpufreq_table_validate_and_show(policy, elanfreq_table);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#16 lore raw

PATCH 13/37 cpufreq: exynos: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/exynos-cpufreq.c     | 2 --
 drivers/cpufreq/exynos5440-cpufreq.c | 1 -
 2 files changed, 3 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +0 -2
index 79b869b..b1db082 100644
@@ -226,8 +226,6 @@ static struct notifier_block exynos_cpufreq_nb = {
 
 static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
-
 	/* set the transition latency value */
 	policy->cpuinfo.transition_latency = 100000;
 
drivers/cpufreq/exynos5440-cpufreq.c +0 -1
index 9a5ed485..91a64d6 100644
@@ -316,7 +316,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	policy->cur = dvfs_info->cur_frequency;
 	policy->cpuinfo.transition_latency = dvfs_info->latency;
 	cpumask_setall(policy->cpus);
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 13/37
#17 lore raw

Re: [PATCH 13/37] cpufreq: exynos: don't initialize part of policy that is set by core too

Quoted 8 lines · Viresh Kumar

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().

This consolidation work looks fine,

Thanks,
Amit

Quoted 37 lines
---
 drivers/cpufreq/exynos-cpufreq.c     | 2 --
 drivers/cpufreq/exynos5440-cpufreq.c | 1 -
 2 files changed, 3 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +0 -2
index 79b869b..b1db082 100644
@@ -226,8 +226,6 @@ static struct notifier_block exynos_cpufreq_nb = {
 
 static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-       policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
-
        /* set the transition latency value */
        policy->cpuinfo.transition_latency = 100000;
 
drivers/cpufreq/exynos5440-cpufreq.c +0 -2
index 9a5ed485..91a64d6 100644
@@ -316,7 +316,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
                return ret;
        }
 
-       policy->cur = dvfs_info->cur_frequency;
        policy->cpuinfo.transition_latency = dvfs_info->latency;
        cpumask_setall(policy->cpus);
 
--

1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by
#18 lore raw

RE: [PATCH 13/37] cpufreq: exynos: don't initialize part of policy that is set by core too

Quoted 12 lines · amit daniel kachhap
Quoted 1 line · Viresh Kumar

Many common initializations of struct policy are moved to core now and

hence

Quoted 3 lines

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

Quoted 3 lines

->init().

Cc Kukjin Kim <[email protected]>

Thanks,
Kukjin

Quoted 13 lines
Quoted 1 line

This consolidation work looks fine,

Thanks,
Amit

drivers/cpufreq/exynos-

Quoted 6 lines
---
 drivers/cpufreq/exynos-cpufreq.c     | 2 --
 drivers/cpufreq/exynos5440-cpufreq.c | 1 -
 2 files changed, 3 deletions(-)
drivers/cpufreq/exynos- renamed from drivers/cpufreq/exynos-cpufreq.c +0 -0

cpufreq.c

Quoted 8 lines

drivers/cpufreq/exynos-cpufreq.c static struct notifier_block exynos_cpufreq_nb = { · line 229

Quoted 8 lines

index 79b869b..b1db082 100644

drivers/cpufreq/exynos-cpufreq.c +0 -1
@@ -226,8 +226,6 @@ static struct notifier_block exynos_cpufreq_nb = {
 
 static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-       policy->cur = policy->min = policy->max =

exynos_getspeed(policy-

Quoted 21 lines

Review

Quoted 6 lines
drivers/cpufreq/exynos-cpufreq.c +0 -1
 cpu);
-
        /* set the transition latency value */
        policy->cpuinfo.transition_latency = 100000;
(quoted diff) +0 -0

b/drivers/cpufreq/exynos5440-cpufreq.c

drivers/cpufreq/exynos5440-cpufreq.c static int exynos_cpufreq_cpu_init(struct

Quoted 4 lines

index 9a5ed485..91a64d6 100644

drivers/cpufreq/exynos5440-cpufreq.c +0 -0
@@ -316,7 +316,6 @@ static int exynos_cpufreq_cpu_init(struct

cpufreq_policy *policy)

Quoted 9 lines
drivers/cpufreq/exynos5440-cpufreq.c +0 -2
                return ret;
        }
 
-       policy->cur = dvfs_info->cur_frequency;
        policy->cpuinfo.transition_latency = dvfs_info->latency;
        cpumask_setall(policy->cpus);
 
--

1.7.12.rc2.18.g61b472e

author maintainer
#19 lore raw

PATCH 14/37 cpufreq: gx: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/gx-suspmod.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpufreq/gx-suspmod.c +1 -4
index 70442c7..d83e826 100644
@@ -401,7 +401,7 @@ static int cpufreq_gx_target(struct cpufreq_policy *policy,
 
 static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
 {
-	unsigned int maxfreq, curfreq;
+	unsigned int maxfreq;
 
 	if (!policy || policy->cpu != 0)
 		return -ENODEV;
@@ -415,10 +415,8 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
 		maxfreq = 30000 * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f];
 
 	stock_freq = maxfreq;
-	curfreq = gx_get_cpuspeed(0);
 
 	pr_debug("cpu max frequency is %d.\n", maxfreq);
-	pr_debug("cpu current frequency is %dkHz.\n", curfreq);
 
 	/* setup basic struct for cpufreq API */
 	policy->cpu = 0;
@@ -428,7 +426,6 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
 	else
 		policy->min = maxfreq / POLICY_MIN_DIV;
 	policy->max = maxfreq;
-	policy->cur = curfreq;
 	policy->cpuinfo.min_freq = maxfreq / max_duration;
 	policy->cpuinfo.max_freq = maxfreq;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#20 lore raw

PATCH 15/37 cpufreq: ia64-acpi: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/ia64-acpi-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/ia64-acpi-cpufreq.c +0 -1
index 371c63d..4695fa2 100644
@@ -290,7 +290,6 @@ acpi_cpufreq_cpu_init (
 			    data->acpi_data.states[i].transition_latency * 1000;
 		}
 	}
-	policy->cur = processor_get_freq(data, policy->cpu);
 
 	/* table init */
 	for (i = 0; i <= data->acpi_data.state_count; i++)
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#21 lore raw

PATCH 16/37 cpufreq: imx6q: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/imx6q-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/imx6q-cpufreq.c +0 -1
index f6f877c..04a32fb 100644
@@ -166,7 +166,6 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	policy->cpuinfo.transition_latency = transition_latency;
-	policy->cur = clk_get_rate(arm_clk) / 1000;
 	cpumask_setall(policy->cpus);
 
 	return 0;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#22 lore raw

PATCH 17/37 cpufreq: integrator: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/integrator-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/integrator-cpufreq.c +2 -3
index f7c99df..6391dd3 100644
@@ -186,10 +186,9 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
 {
 
 	/* set default policy and cpuinfo */
-	policy->cpuinfo.max_freq = 160000;
-	policy->cpuinfo.min_freq = 12000;
+	policy->max = policy->cpuinfo.max_freq = 160000;
+	policy->min = policy->cpuinfo.min_freq = 12000;
 	policy->cpuinfo.transition_latency = 1000000; /* 1 ms, assumed */
-	policy->cur = policy->min = policy->max = integrator_get(policy->cpu);
 
 	return 0;
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#23 lore raw

PATCH 18/37 cpufreq: kirkwood: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/kirkwood-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/kirkwood-cpufreq.c +0 -1
index d0d107a..c3d6987 100644
@@ -109,7 +109,6 @@ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 5000; /* 5uS */
-	policy->cur = kirkwood_cpufreq_get_cpu_frequency(0);
 
 	return cpufreq_table_validate_and_show(policy, kirkwood_freq_table);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#24 lore raw

PATCH 19/37 cpufreq: longhaul: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/longhaul.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/longhaul.c +0 -1
index e566776..45bafdd 100644
@@ -904,7 +904,6 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
 		longhaul_setup_voltagescaling();
 
 	policy->cpuinfo.transition_latency = 200000;	/* nsec */
-	policy->cur = calc_speed(longhaul_get_cpu_mult());
 
 	return cpufreq_table_validate_and_show(policy, longhaul_table);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#25 lore raw

PATCH 20/37 cpufreq: loongson2: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/loongson2_cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/loongson2_cpufreq.c +0 -2
index 009c29c..c33347c 100644
@@ -120,8 +120,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	policy->cur = loongson2_cpufreq_get(policy->cpu);
-
 	return cpufreq_table_validate_and_show(policy,
 					    &loongson2_clockmod_table[0]);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#26 lore raw

PATCH 21/37 cpufreq: maple: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 Dmitry Eremin-Solenikov <[email protected]>
---
 drivers/cpufreq/maple-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/maple-cpufreq.c +0 -1
index 1c24219..b508147 100644
@@ -158,7 +158,6 @@ static unsigned int maple_cpufreq_get_speed(unsigned int cpu)
 static int maple_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	policy->cpuinfo.transition_latency = 12000;
-	policy->cur = maple_cpu_freqs[maple_scom_query_freq()].frequency;
 	/* secondary CPUs are tied to the primary one by the
 	 * cpufreq core if in the secondary policy we tell it that
 	 * it actually must be one policy together with all others. */
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#27 lore raw

PATCH 22/37 cpufreq: omap: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 Santosh Shilimkar <[email protected]>
---
 drivers/cpufreq/omap-cpufreq.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/cpufreq/omap-cpufreq.c +0 -4
index 69bf7d8..92d45e6 100644
@@ -146,8 +146,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
 		goto fail_ck;
 	}
 
-	policy->cur = omap_getspeed(policy->cpu);
-
 	if (!freq_table)
 		result = opp_init_cpufreq_table(mpu_dev, &freq_table);
 
@@ -163,8 +161,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
 	if (result)
 		goto fail_table;
 
-	policy->cur = omap_getspeed(policy->cpu);
-
 	/*
 	 * On OMAP SMP configuartion, both processors share the voltage
 	 * and clock. So both CPUs needs to be scaled together and hence
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#28 lore raw

PATCH 23/37 cpufreq: p4: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 <[email protected]>
---
 drivers/cpufreq/p4-clockmod.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/p4-clockmod.c +0 -1
index 5a6263e..3c23053 100644
@@ -220,7 +220,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
 	/* the transition latency is set to be 1 higher than the maximum
 	 * transition latency of the ondemand governor */
 	policy->cpuinfo.transition_latency = 10000001;
-	policy->cur = stock_freq;
 
 	return cpufreq_table_validate_and_show(policy, &p4clockmod_table[0]);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#29 lore raw

PATCH 24/37 cpufreq: pcc: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/pcc-cpufreq.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/cpufreq/pcc-cpufreq.c +0 -7
index d81c4e5..0624bee 100644
@@ -560,13 +560,6 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		ioread32(&pcch_hdr->nominal) * 1000;
 	policy->min = policy->cpuinfo.min_freq =
 		ioread32(&pcch_hdr->minimum_frequency) * 1000;
-	policy->cur = pcc_get_freq(cpu);
-
-	if (!policy->cur) {
-		pr_debug("init: Unable to get current CPU frequency\n");
-		result = -EINVAL;
-		goto out;
-	}
 
 	pr_debug("init: policy->max is %d, policy->min is %d\n",
 		policy->max, policy->min);
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#30 lore raw

PATCH 25/37 cpufreq: pmac: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/pmac32-cpufreq.c | 1 -
 drivers/cpufreq/pmac64-cpufreq.c | 1 -
 2 files changed, 2 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +0 -1
index b1ba708..47c227c 100644
@@ -389,7 +389,6 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return -ENODEV;
 
 	policy->cpuinfo.transition_latency	= transition_latency;
-	policy->cur = cur_freq;
 
 	return cpufreq_table_validate_and_show(policy, pmac_cpu_freqs);
 }
drivers/cpufreq/pmac64-cpufreq.c +0 -1
index 7679990..63f9642 100644
@@ -338,7 +338,6 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
 static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	policy->cpuinfo.transition_latency = transition_latency;
-	policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
 	/* secondary CPUs are tied to the primary one by the
 	 * cpufreq core if in the secondary policy we tell it that
 	 * it actually must be one policy together with all others. */
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#31 lore raw

PATCH 26/37 cpufreq: powernow: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/powernow-k6.c | 1 -
 drivers/cpufreq/powernow-k7.c | 2 --
 drivers/cpufreq/powernow-k8.c | 3 ---
 3 files changed, 6 deletions(-)
drivers/cpufreq/powernow-k6.c +0 -1
index cb19fb8..643e795 100644
@@ -126,7 +126,6 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
 
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 200000;
-	policy->cur = busfreq * max_multiplier;
 
 	return cpufreq_table_validate_and_show(policy, clock_ratio);
 }
drivers/cpufreq/powernow-k7.c +0 -2
index 7c76f03..946708a 100644
@@ -659,8 +659,6 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency =
 		cpufreq_scale(2000000UL, fsb, latency);
 
-	policy->cur = powernow_get(0);
-
 	return cpufreq_table_validate_and_show(policy, powernow_table);
 }
 
drivers/cpufreq/powernow-k8.c +0 -3
index 80bc606..62a1ce4 100644
@@ -1133,9 +1133,6 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
 	cpumask_copy(pol->cpus, cpu_core_mask(pol->cpu));
 	data->available_cores = pol->cpus;
 
-	pol->cur = find_khz_freq_from_fid(data->currfid);
-	pr_debug("policy current frequency %d kHz\n", pol->cur);
-
 	/* min/max the cpu is capable of */
 	if (cpufreq_table_validate_and_show(pol, data->powernow_table)) {
 		printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n");
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#32 lore raw

PATCH 27/37 cpufreq: ppc: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/ppc-corenet-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/ppc-corenet-cpufreq.c +0 -2
index 243a396..79d8e9c 100644
@@ -217,8 +217,6 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		per_cpu(cpu_data, i) = data;
 
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	policy->cur = corenet_cpufreq_get_speed(policy->cpu);
-
 	of_node_put(np);
 
 	return 0;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#33 lore raw

PATCH 28/37 cpufreq: pxa: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/pxa2xx-cpufreq.c | 2 --
 drivers/cpufreq/pxa3xx-cpufreq.c | 7 +++----
 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/cpufreq/pxa2xx-cpufreq.c +0 -2
index a91274a..183bc13 100644
@@ -388,8 +388,6 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy)
 
 	/* set default policy and cpuinfo */
 	policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */
-	policy->cur = get_clk_frequency_khz(0);	   /* current freq */
-	policy->min = policy->max = policy->cur;
 
 	/* Generate pxa25x the run cpufreq_frequency_table struct */
 	for (i = 0; i < NUM_PXA25x_RUN_FREQS; i++) {
drivers/cpufreq/pxa3xx-cpufreq.c +3 -4
index 61e3e6a..132e37d 100644
@@ -190,11 +190,10 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy)
 	int ret = -EINVAL;
 
 	/* set default policy and cpuinfo */
-	policy->cpuinfo.min_freq = 104000;
-	policy->cpuinfo.max_freq = (cpu_is_pxa320()) ? 806000 : 624000;
+	policy->min = policy->cpuinfo.min_freq = 104000;
+	policy->max = policy->cpuinfo.max_freq =
+		(cpu_is_pxa320()) ? 806000 : 624000;
 	policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */
-	policy->max = pxa3xx_get_clk_frequency_khz(0);
-	policy->cur = policy->min = policy->max;
 
 	if (cpu_is_pxa300() || cpu_is_pxa310())
 		ret = setup_freqs_table(policy, pxa300_freqs,
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#34 lore raw

PATCH 29/37 cpufreq: s3c: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/s3c2416-cpufreq.c | 2 --
 drivers/cpufreq/s3c24xx-cpufreq.c | 5 -----
 drivers/cpufreq/s3c64xx-cpufreq.c | 2 --
 3 files changed, 9 deletions(-)
drivers/cpufreq/s3c2416-cpufreq.c +0 -2
index 90efbf5..9b22cc4 100644
@@ -467,8 +467,6 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)
 		freq++;
 	}
 
-	policy->cur = clk_get_rate(s3c_freq->armclk) / 1000;
-
 	/* Datasheet says PLL stabalisation time must be at least 300us,
 	 * so but add some fudge. (reference in LOCKCON0 register description)
 	 */
drivers/cpufreq/s3c24xx-cpufreq.c +0 -5
index 027dec1..e0fbaef 100644
@@ -378,11 +378,6 @@ static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 	if (policy->cpu != 0)
 		return -EINVAL;
 
-	policy->cur = s3c_cpufreq_get(0);
-	policy->min = policy->cpuinfo.min_freq = 0;
-	policy->max = policy->cpuinfo.max_freq = cpu_cur.info->max.fclk / 1000;
-	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
-
 	/* feed the latency information from the cpu driver */
 	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
 
drivers/cpufreq/s3c64xx-cpufreq.c +0 -2
index 72f733b..5357dc4 100644
@@ -225,8 +225,6 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
 		freq++;
 	}
 
-	policy->cur = clk_get_rate(armclk) / 1000;
-
 	/* Datasheet says PLL stabalisation time (if we were to use
 	 * the PLLs, which we don't currently) is ~300us worst case,
 	 * but add some fudge.
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#35 lore raw

PATCH 30/37 cpufreq: s5pv210: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/s5pv210-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/s5pv210-cpufreq.c +0 -2
index bdffc3d..76a4177 100644
@@ -515,8 +515,6 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy)
 	s5pv210_dram_conf[1].refresh = (__raw_readl(S5P_VA_DMC1 + 0x30) * 1000);
 	s5pv210_dram_conf[1].freq = clk_get_rate(dmc1_clk);
 
-	policy->cur = policy->min = policy->max = s5pv210_getspeed(0);
-
 	policy->cpuinfo.transition_latency = 40000;
 
 	return cpufreq_table_validate_and_show(policy, s5pv210_freq_table);
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#36 lore raw

PATCH 31/37 cpufreq: sa11x0: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/sa1100-cpufreq.c | 1 -
 drivers/cpufreq/sa1110-cpufreq.c | 1 -
 2 files changed, 2 deletions(-)
drivers/cpufreq/sa1100-cpufreq.c +0 -1
index b9e131e..aa49a08 100644
@@ -204,7 +204,6 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = sa11x0_getspeed(0);
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
 	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
drivers/cpufreq/sa1110-cpufreq.c +0 -1
index fb69553..c00cf2b 100644
@@ -316,7 +316,6 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = sa11x0_getspeed(0);
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
 	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#37 lore raw

PATCH 32/37 cpufreq: sc520_freq: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/sc520_freq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/sc520_freq.c +0 -1
index cd62472..6c86452 100644
@@ -94,7 +94,6 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
 
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 1000000; /* 1ms */
-	policy->cur = sc520_freq_get_cpu_frequency(0);
 
 	return cpufreq_table_validate_and_show(policy, sc520_freq_table);
 }
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#38 lore raw

PATCH 33/37 cpufreq: sh: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/sh-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/sh-cpufreq.c +0 -2
index 91c6446..018348b 100644
@@ -114,8 +114,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return PTR_ERR(cpuclk);
 	}
 
-	policy->cur = sh_cpufreq_get(cpu);
-
 	freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
 	if (freq_table) {
 		int result;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#39 lore raw

PATCH 34/37 cpufreq: spear: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/spear-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/spear-cpufreq.c +0 -2
index 88aa5cf..efacfa1 100644
@@ -176,8 +176,6 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency;
-	policy->cur = spear_cpufreq_get(0);
-
 	cpumask_setall(policy->cpus);
 
 	return 0;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#40 lore raw

PATCH 35/37 cpufreq: speedstep: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 <[email protected]>
---
 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(-)
drivers/cpufreq/speedstep-centrino.c +0 -5
index b309774..b7a2f8d 100644
@@ -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);
drivers/cpufreq/speedstep-ich.c +1 -14
index be63486..707721e 100644
@@ -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);
 }
 
drivers/cpufreq/speedstep-smi.c +0 -13
index 878e64b..19446e4 100644
@@ -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);
 }
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#41 lore raw

PATCH 36/37 cpufreq: tegra: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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 Stephen Warren <[email protected]>
---
 drivers/cpufreq/tegra-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cpufreq/tegra-cpufreq.c +1 -2
index ee2cf8f3..3c2b12b 100644
@@ -205,8 +205,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 	clk_prepare_enable(cpu_clk);
 
 	cpufreq_table_validate_and_show(policy, freq_table);
-	policy->cur = tegra_getspeed(policy->cpu);
-	target_cpu_speed[policy->cpu] = policy->cur;
+	target_cpu_speed[policy->cpu] = tegra_getspeed(policy->cpu);
 
 	/* FIXME: what's the actual transition time? */
 	policy->cpuinfo.transition_latency = 300 * 1000;
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#42 lore raw

PATCH 37/37 cpufreq: unicore2: don't initialize part of policy that is set by core too

In reply to Viresh Kumar

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().

---
 drivers/cpufreq/unicore2-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/unicore2-cpufreq.c +0 -1
index b225f04..79ca32e 100644
@@ -68,7 +68,6 @@ static int __init ucv2_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = ucv2_getspeed(0);
 	policy->min = policy->cpuinfo.min_freq = 250000;
 	policy->max = policy->cpuinfo.max_freq = 1000000;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
Signature · 1 line
1.7.12.rc2.18.g61b472e