From 4386ad853cdf8f13d95214454e98a2334d3a77c1 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 24 Aug 2004 20:49:29 +0100 Subject: [PATCH] [CPUFREQ] Work around some broken userspace daemons. Some daemons try to set the speed to the same speed we're currently running at. Detect that, and bail out early before we fiddle with registers and such. Signed-off-by: Dave Jones --- arch/i386/kernel/cpu/cpufreq/longhaul.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index 4a4bab4f71007..62dde5592a1f8 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c @@ -163,7 +163,7 @@ static void do_powersaver(union msr_longhaul *longhaul, * longhaul_set_cpu_frequency() * @clock_ratio_index : bitpattern of the new multiplier. * - * Sets a new clock ratio, and -if applicable- a new Front Side Bus + * Sets a new clock ratio. */ static void longhaul_setstate(unsigned int clock_ratio_index) @@ -172,6 +172,11 @@ static void longhaul_setstate(unsigned int clock_ratio_index) struct cpufreq_freqs freqs; union msr_longhaul longhaul; union msr_bcr2 bcr2; + static unsigned int old_ratio=-1; + + if (old_ratio == clock_ratio_index) + return; + oldratio = clock_ratio_index; mult = clock_ratio[clock_ratio_index]; if (mult == -1) @@ -562,7 +567,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy) break; } - printk (KERN_INFO PFX "VIA %s CPU detected.", cpuname); + printk (KERN_INFO PFX "VIA %s CPU detected. ", cpuname); switch (longhaul_version) { case TYPE_LONGHAUL_V1: case TYPE_LONGHAUL_V2: -- 2.53.0