[CPUFREQ] Crusoe: longrun cpufreq module reports false min freq
authormaximilian attems <max@stro.at>
Thu, 8 May 2008 20:10:01 +0000 (22:10 +0200)
committerDave Jones <davej@redhat.com>
Mon, 19 May 2008 22:17:28 +0000 (18:17 -0400)
The longrun cpufreq module reports a false minimum frequency 3MHz on
300-600MHz Crusoe processor.  This may be due to a calculation bug
in the module.

Original patch from Kaz Sasayama <kazssym@hypercore.co.jp>
submitted as http://bugs.debian.org/468149 patch ported to x86

Cc: Kaz Sasayama <kazssym@hypercore.co.jp>
Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Dave Jones <davej@redhat.com>
arch/x86/kernel/cpu/cpufreq/longrun.c

index af4a867..777a7ff 100644 (file)
@@ -245,7 +245,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
        if ((ecx > 95) || (ecx == 0) || (eax < ebx))
                return -EIO;
 
-       edx = (eax - ebx) / (100 - ecx);
+       edx = ((eax - ebx) * 100) / (100 - ecx);
        *low_freq = edx * 1000; /* back to kHz */
 
        dprintk("low frequency is %u kHz\n", *low_freq);