Re: [PATCH 1/2] CPUFREQ: Enable acpi-cpufreq driver for VIA/Centaur CPUs

Michael S. Zick
2009-06-08T20:03:39Z

On Mon June 8 2009, Harald Welte wrote:
> The VIA/Centaur C7, C7-M and Nano CPU's all support ACPI based cpu p-states
> using a MSR interface. The Linux driver just never made use of it, since in
> addition to the check for the EST flag it also checked if the vendor is Intel.
>
> Signed-off-by: Harald Welte <HaraldWelte@viatech.com>
> ---
> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
> index 208ecf6..ee03585 100644
> --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
> +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
> @@ -90,7 +90,8 @@ static int check_est_cpu(unsigned int cpuid)
> {
> struct cpuinfo_x86 *cpu = &cpu_data(cpuid);
>
> - if (cpu->x86_vendor != X86_VENDOR_INTEL ||
> + if ((cpu->x86_vendor != X86_VENDOR_INTEL &&
> + cpu->x86_vendor != X86_VENDOR_CENTAUR) ||
> !cpu_has(cpu, X86_FEATURE_EST))
> return 0;
>

For my own internal testing, based on subsequent posts, I simplified
that to:

static int check_est_cpu(unsigned int cpuid)
{
struct cpuinfo_x86 *cpu = &cpu_data(cpuid);

if (!cpu_has(cpu, X86_FEATURE_EST))
return 0;

return 1;
}

Have not done anything (yet) to deal with the adaptive controller,
**which is safe to (not) do on my test system because I know it isn't enabled**

Note: This machine is known to run common, proprietary operating systems,
so I am also assuming its BIOS ACPI is complete enough.

Note 2: Don't try this unless you have a machine to waste. ;)

Mike