Commit 4e1e90fa authored by Dave Jones's avatar Dave Jones

[CPUFREQ] speedstep-centrino and acpi-cpufreq: P4 TSC rate is constant

From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>

In P4, CPU tsc rate won't change with CPU frequency change while using Enhanced
Speedstep Technology. Tested with both speedstep-centrino and acpi-cpufreq on
both i386 and x86-64.
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent eba294f7
......@@ -38,6 +38,8 @@
#include <linux/acpi.h>
#include <acpi/processor.h>
#include "speedstep-est-common.h"
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
......@@ -53,6 +55,7 @@ struct cpufreq_acpi_io {
static struct cpufreq_acpi_io *acpi_io_data[NR_CPUS];
static struct cpufreq_driver acpi_cpufreq_driver;
static int
acpi_processor_write_port(
......@@ -374,6 +377,10 @@ acpi_cpufreq_cpu_init (
if (result)
goto err_free;
if (is_const_loops_cpu(cpu)) {
acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
}
/* capability check */
if (data->acpi_data.state_count <= 1) {
dprintk("No P-States\n");
......
......@@ -34,6 +34,8 @@
#include <asm/processor.h>
#include <asm/cpufeature.h>
#include "speedstep-est-common.h"
#define PFX "speedstep-centrino: "
#define MAINTAINER "Jeremy Fitzhardinge <jeremy@goop.org>"
......@@ -76,6 +78,8 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, const struct cpu_
static struct cpu_model *centrino_model[NR_CPUS];
static const struct cpu_id *centrino_cpu[NR_CPUS];
static struct cpufreq_driver centrino_driver;
#ifdef CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE
/* Computes the correct form for IA32_PERF_CTL MSR for a particular
......@@ -508,6 +512,10 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
if (i != N_IDS)
centrino_cpu[policy->cpu] = &cpu_ids[i];
if (is_const_loops_cpu(policy->cpu)) {
centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
}
if (centrino_cpu_init_acpi(policy)) {
if (policy->cpu != 0)
return -ENODEV;
......
/*
* Routines common for drivers handling Enhanced Speedstep Technology
* Copyright (C) 2004 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
*
* Licensed under the terms of the GNU GPL License version 2 -- see
* COPYING for details.
*/
static inline int is_const_loops_cpu(unsigned int cpu)
{
struct cpuinfo_x86 *c = cpu_data + cpu;
if (c->x86_vendor != X86_VENDOR_INTEL || !cpu_has(c, X86_FEATURE_EST))
return 0;
/*
* on P-4s, the TSC runs with constant frequency independent of cpu freq
* when we use EST
*/
if (c->x86 == 0xf)
return 1;
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment