]> git.hungrycats.org Git - linux/commitdiff
[CPUFREQ] Work around some broken userspace daemons.
authorDave Jones <davej@redhat.com>
Tue, 24 Aug 2004 19:49:29 +0000 (20:49 +0100)
committerDave Jones <davej@delerium.codemonkey.org.uk>
Tue, 24 Aug 2004 19:49:29 +0000 (20:49 +0100)
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 <davej@redhat.com>
arch/i386/kernel/cpu/cpufreq/longhaul.c

index 4a4bab4f7100753774d49516f634a583eee5e8f2..62dde5592a1f84d7c77c13f6f3dcf41a24fb61a1 100644 (file)
@@ -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: