public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/3] cpufreq: Remove unused function __cpufreq_driver_getavg
@ 2013-06-03 19:48 Stratos Karafotis
  2013-06-04  5:19 ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Stratos Karafotis @ 2013-06-03 19:48 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, linux-pm, cpufreq,
	linux-kernel

Calculation of frequency target in ondemand governor changed and it is
independent from measured average frequency.

Remove unused__cpufreq_driver_getavg function and getavg member from
cpufreq_driver struct. Also, remove the callback getavg in
acpi_cpufreq_driver.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
 drivers/cpufreq/Makefile       |  2 +-
 drivers/cpufreq/acpi-cpufreq.c |  5 -----
 drivers/cpufreq/cpufreq.c      | 12 ------------
 include/linux/cpufreq.h        |  6 ------
 4 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 6ad0b91..aebd4ef 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_GENERIC_CPUFREQ_CPU0)	+= cpufreq-cpu0.o
 # powernow-k8 can load then. ACPI is preferred to all other hardware-specific drivers.
 # speedstep-* is preferred over p4-clockmod.
 
-obj-$(CONFIG_X86_ACPI_CPUFREQ)		+= acpi-cpufreq.o mperf.o
+obj-$(CONFIG_X86_ACPI_CPUFREQ)		+= acpi-cpufreq.o
 obj-$(CONFIG_X86_POWERNOW_K8)		+= powernow-k8.o
 obj-$(CONFIG_X86_PCC_CPUFREQ)		+= pcc-cpufreq.o
 obj-$(CONFIG_X86_POWERNOW_K6)		+= powernow-k6.o
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 17e3496..d3a5f35 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -45,7 +45,6 @@
 #include <asm/msr.h>
 #include <asm/processor.h>
 #include <asm/cpufeature.h>
-#include "mperf.h"
 
 MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
 MODULE_DESCRIPTION("ACPI Processor P-States Driver");
@@ -842,10 +841,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	/* notify BIOS that we exist */
 	acpi_processor_notify_smm(THIS_MODULE);
 
-	/* Check for APERF/MPERF support in hardware */
-	if (boot_cpu_has(X86_FEATURE_APERFMPERF))
-		acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf;
-
 	pr_debug("CPU%u - ACPI performance management activated.\n", cpu);
 	for (i = 0; i < perf->state_count; i++)
 		pr_debug("     %cP%d: %d MHz, %d mW, %d uS\n",
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f8c2860..a61aacb 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1584,18 +1584,6 @@ fail:
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
-int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
-{
-	if (cpufreq_disabled())
-		return 0;
-
-	if (!cpufreq_driver->getavg)
-		return 0;
-
-	return cpufreq_driver->getavg(policy, cpu);
-}
-EXPORT_SYMBOL_GPL(__cpufreq_driver_getavg);
-
 /*
  * when "event" is CPUFREQ_GOV_LIMITS
  */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index d939056..50f19ad 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -215,10 +215,6 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
 				   unsigned int target_freq,
 				   unsigned int relation);
 
-
-extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy,
-				   unsigned int cpu);
-
 int cpufreq_register_governor(struct cpufreq_governor *governor);
 void cpufreq_unregister_governor(struct cpufreq_governor *governor);
 
@@ -258,8 +254,6 @@ struct cpufreq_driver {
 	unsigned int	(*get)	(unsigned int cpu);
 
 	/* optional */
-	unsigned int (*getavg)	(struct cpufreq_policy *policy,
-				 unsigned int cpu);
 	int	(*bios_limit)	(int cpu, unsigned int *limit);
 
 	int	(*exit)		(struct cpufreq_policy *policy);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/3] cpufreq: Remove unused function __cpufreq_driver_getavg
@ 2013-06-05  9:35 Stratos Karafotis
  0 siblings, 0 replies; 5+ messages in thread
From: Stratos Karafotis @ 2013-06-05  9:35 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, Thomas Gleixner, Ingo Molnar,  H. Peter Anvin,
	linux-pm, cpufreq, linux-kernel

I think you are right. I will reorder 2/3 and 3/3 with the change you suggested.

Thanks,
Stratos

Viresh Kumar <viresh.kumar@linaro.org> wrote:

>On 4 June 2013 20:36, Stratos Karafotis <stratosk@semaphore.gr> wrote:
>> On 06/04/2013 08:19 AM, Viresh Kumar wrote:
>>> Should this be done in 3/3 ?
>>>
>>
>> acpi-cpufreq does not use mperf after 2/3. Why should we compile it with
>> CONFIG_X86_ACPI_CPUFREQ?
>> Do you want me to move the change in 3/3?
>
>I somehow feel now that 3/3 should come before 2/3 and then this change
>should be merged into it. And at the end we can have this patch as 3/3..
>
>What do you say? core should go last and users/drivers must go first.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-05  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 19:48 [PATCH v2 2/3] cpufreq: Remove unused function __cpufreq_driver_getavg Stratos Karafotis
2013-06-04  5:19 ` Viresh Kumar
2013-06-04 15:06   ` Stratos Karafotis
2013-06-05  8:42     ` Viresh Kumar
  -- strict thread matches above, loose matches on Subject: below --
2013-06-05  9:35 Stratos Karafotis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox