aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2013-06-05 12:01:42 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-25 19:06:43 -0400
commit61c63e5ed3b9c472899d7152e961f2ffaafcf5a0 (patch)
treee84b694d4640fd0e1ba527ec63e41e3edfddeb04 /drivers/cpufreq
parentdfa5bb622555d9da0df21b50f46ebdeef390041b (diff)
cpufreq: Remove unused APERF/MPERF support
The target frequency calculation method in the ondemand governor has changed and it is now independent of the measured average frequency. Consequently, the APERF/MPERF support in cpufreq is not used any more, so drop it. [rjw: Changelog] Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/Makefile2
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c5
-rw-r--r--drivers/cpufreq/mperf.c51
-rw-r--r--drivers/cpufreq/mperf.h9
4 files changed, 1 insertions, 66 deletions
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index d345b5a7aa71..ad5866c2ada0 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_GENERIC_CPUFREQ_CPU0) += cpufreq-cpu0.o
23# powernow-k8 can load then. ACPI is preferred to all other hardware-specific drivers. 23# powernow-k8 can load then. ACPI is preferred to all other hardware-specific drivers.
24# speedstep-* is preferred over p4-clockmod. 24# speedstep-* is preferred over p4-clockmod.
25 25
26obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o mperf.o 26obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
27obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o 27obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
28obj-$(CONFIG_X86_PCC_CPUFREQ) += pcc-cpufreq.o 28obj-$(CONFIG_X86_PCC_CPUFREQ) += pcc-cpufreq.o
29obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o 29obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 39264020b88a..e673670d2321 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -45,7 +45,6 @@
45#include <asm/msr.h> 45#include <asm/msr.h>
46#include <asm/processor.h> 46#include <asm/processor.h>
47#include <asm/cpufeature.h> 47#include <asm/cpufeature.h>
48#include "mperf.h"
49 48
50MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); 49MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
51MODULE_DESCRIPTION("ACPI Processor P-States Driver"); 50MODULE_DESCRIPTION("ACPI Processor P-States Driver");
@@ -861,10 +860,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
861 /* notify BIOS that we exist */ 860 /* notify BIOS that we exist */
862 acpi_processor_notify_smm(THIS_MODULE); 861 acpi_processor_notify_smm(THIS_MODULE);
863 862
864 /* Check for APERF/MPERF support in hardware */
865 if (boot_cpu_has(X86_FEATURE_APERFMPERF))
866 acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf;
867
868 pr_debug("CPU%u - ACPI performance management activated.\n", cpu); 863 pr_debug("CPU%u - ACPI performance management activated.\n", cpu);
869 for (i = 0; i < perf->state_count; i++) 864 for (i = 0; i < perf->state_count; i++)
870 pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n", 865 pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n",
diff --git a/drivers/cpufreq/mperf.c b/drivers/cpufreq/mperf.c
deleted file mode 100644
index 911e193018ae..000000000000
--- a/drivers/cpufreq/mperf.c
+++ /dev/null
@@ -1,51 +0,0 @@
1#include <linux/kernel.h>
2#include <linux/smp.h>
3#include <linux/module.h>
4#include <linux/init.h>
5#include <linux/cpufreq.h>
6#include <linux/slab.h>
7
8#include "mperf.h"
9
10static DEFINE_PER_CPU(struct aperfmperf, acfreq_old_perf);
11
12/* Called via smp_call_function_single(), on the target CPU */
13static void read_measured_perf_ctrs(void *_cur)
14{
15 struct aperfmperf *am = _cur;
16
17 get_aperfmperf(am);
18}
19
20/*
21 * Return the measured active (C0) frequency on this CPU since last call
22 * to this function.
23 * Input: cpu number
24 * Return: Average CPU frequency in terms of max frequency (zero on error)
25 *
26 * We use IA32_MPERF and IA32_APERF MSRs to get the measured performance
27 * over a period of time, while CPU is in C0 state.
28 * IA32_MPERF counts at the rate of max advertised frequency
29 * IA32_APERF counts at the rate of actual CPU frequency
30 * Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
31 * no meaning should be associated with absolute values of these MSRs.
32 */
33unsigned int cpufreq_get_measured_perf(struct cpufreq_policy *policy,
34 unsigned int cpu)
35{
36 struct aperfmperf perf;
37 unsigned long ratio;
38 unsigned int retval;
39
40 if (smp_call_function_single(cpu, read_measured_perf_ctrs, &perf, 1))
41 return 0;
42
43 ratio = calc_aperfmperf_ratio(&per_cpu(acfreq_old_perf, cpu), &perf);
44 per_cpu(acfreq_old_perf, cpu) = perf;
45
46 retval = (policy->cpuinfo.max_freq * ratio) >> APERFMPERF_SHIFT;
47
48 return retval;
49}
50EXPORT_SYMBOL_GPL(cpufreq_get_measured_perf);
51MODULE_LICENSE("GPL");
diff --git a/drivers/cpufreq/mperf.h b/drivers/cpufreq/mperf.h
deleted file mode 100644
index 5dbf2950dc22..000000000000
--- a/drivers/cpufreq/mperf.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * (c) 2010 Advanced Micro Devices, Inc.
3 * Your use of this code is subject to the terms and conditions of the
4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html
6 */
7
8unsigned int cpufreq_get_measured_perf(struct cpufreq_policy *policy,
9 unsigned int cpu);