Index: linux-2.5/arch/i386/kernel/cpu/cpufreq/longrun.c =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/arch/i386/kernel/cpu/cpufreq/longrun.c,v retrieving revision 1.19 diff -u -r1.19 longrun.c --- linux-2.5/arch/i386/kernel/cpu/cpufreq/longrun.c 13 Apr 2004 15:52:00 -0000 1.19 +++ linux-2.5/arch/i386/kernel/cpu/cpufreq/longrun.c 6 May 2004 05:32:50 -0000 @@ -46,11 +46,16 @@ rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); msr_lo &= 0x0000007F; msr_hi &= 0x0000007F; - - policy->min = longrun_low_freq + msr_lo * - ((longrun_high_freq - longrun_low_freq) / 100); - policy->max = longrun_low_freq + msr_hi * - ((longrun_high_freq - longrun_low_freq) / 100); + + if ( longrun_high_freq <= longrun_low_freq ) { + /* Assume degenerate Longrun table */ + policy->min = policy->max = longrun_high_freq; + } else { + policy->min = longrun_low_freq + msr_lo * + ((longrun_high_freq - longrun_low_freq) / 100); + policy->max = longrun_low_freq + msr_hi * + ((longrun_high_freq - longrun_low_freq) / 100); + } policy->cpu = 0; } @@ -70,10 +75,15 @@ if (!policy) return -EINVAL; - pctg_lo = (policy->min - longrun_low_freq) / - ((longrun_high_freq - longrun_low_freq) / 100); - pctg_hi = (policy->max - longrun_low_freq) / - ((longrun_high_freq - longrun_low_freq) / 100); + if ( longrun_high_freq <= longrun_low_freq ) { + /* Assume degenerate Longrun table */ + pctg_lo = pctg_hi = 100; + } else { + pctg_lo = (policy->min - longrun_low_freq) / + ((longrun_high_freq - longrun_low_freq) / 100); + pctg_hi = (policy->max - longrun_low_freq) / + ((longrun_high_freq - longrun_low_freq) / 100); + } if (pctg_hi > 100) pctg_hi = 100;