Skip to contentSkip to conversation

Crusoe: longrun cpufreq module reports false min freq

PATCH New maximilian attems 1 participant 1 message May 8, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Crusoe: longrun cpufreq module reports false min freq

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 <[email protected]> submitted as http://bugs.debian.org/468149 patch ported to x86

---
 arch/x86/kernel/cpu/cpufreq/longrun.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/cpufreq/longrun.c +1 -1
index af4a867..777a7ff 100644
@@ -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);
Signature · 1 line
1.5.5.1