Commit d9fa7b95 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] SPEEDSTEP_RELAXED_CAP_CHECK option.

A few SpeedStep-capable systems don't perform according to specification: the
CPUID and/or some MSRs don't tell us the CPU is SpeedStep capable even though
it definitely is. Allow a relaxed checking for one such issue by a module
parameter only available if a config option is turned on. This is done to
avoid the risk of doing invalid speedstep instructions on systems which do
not support it, and which might even lead to (hardware) failure.
                                                                                                   
Patch originally from Andres Aeriksson (?) aeriksson at fastmail (dot) fm
parent f8267800
...@@ -176,6 +176,16 @@ config X86_SPEEDSTEP_LIB ...@@ -176,6 +176,16 @@ config X86_SPEEDSTEP_LIB
depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
config X86_SPEEDSTEP_RELAXED_CAP_CHECK
bool "Relaxed speedstep capability checks"
depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH)
help
Don't perform all checks for a speedstep capable system which would
normally be done. Some ancient or strange systems, though speedstep
capable, don't always indicate that they are speedstep capable. This
option let's the probing code bypass some of those checks if the
parameter "relaxed_check=1" is passed to the module.
config X86_LONGRUN config X86_LONGRUN
tristate "Transmeta LongRun" tristate "Transmeta LongRun"
depends on CPU_FREQ depends on CPU_FREQ
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -30,6 +31,12 @@ ...@@ -30,6 +31,12 @@
#define dprintk(msg...) do { } while(0) #define dprintk(msg...) do { } while(0)
#endif #endif
#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
static int relaxed_check = 0;
#else
#define relaxed_check 0
#endif
/********************************************************************* /*********************************************************************
* GET PROCESSOR CORE SPEED IN KHZ * * GET PROCESSOR CORE SPEED IN KHZ *
*********************************************************************/ *********************************************************************/
...@@ -265,6 +272,7 @@ unsigned int speedstep_detect_processor (void) ...@@ -265,6 +272,7 @@ unsigned int speedstep_detect_processor (void)
ebx = cpuid_ebx(0x00000001); ebx = cpuid_ebx(0x00000001);
ebx &= 0x000000FF; ebx &= 0x000000FF;
if (ebx != 0x06) if (ebx != 0x06)
return 0; return 0;
...@@ -292,7 +300,7 @@ unsigned int speedstep_detect_processor (void) ...@@ -292,7 +300,7 @@ unsigned int speedstep_detect_processor (void)
*/ */
rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi); dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi);
if ((msr_hi & (1<<18)) && (msr_hi & (3<<24))) { if ((msr_hi & (1<<18)) && (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
if (c->x86_mask == 0x01) if (c->x86_mask == 0x01)
return SPEEDSTEP_PROCESSOR_PIII_C_EARLY; return SPEEDSTEP_PROCESSOR_PIII_C_EARLY;
else else
...@@ -362,6 +370,11 @@ unsigned int speedstep_get_freqs(unsigned int processor, ...@@ -362,6 +370,11 @@ unsigned int speedstep_get_freqs(unsigned int processor,
} }
EXPORT_SYMBOL_GPL(speedstep_get_freqs); EXPORT_SYMBOL_GPL(speedstep_get_freqs);
#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
module_param(relaxed_check, int, 0444);
MODULE_PARM_DESC(relaxed_check, "Don't do all checks for speedstep capability.");
#endif
MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>"); MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>");
MODULE_DESCRIPTION ("Library for Intel SpeedStep 1 or 2 cpufreq drivers."); MODULE_DESCRIPTION ("Library for Intel SpeedStep 1 or 2 cpufreq drivers.");
MODULE_LICENSE ("GPL"); MODULE_LICENSE ("GPL");
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