Re: [2.6.0 cpufreq] longhaul trouble

From: Dave Jones
Date: Fri Dec 19 2003 - 13:05:35 EST


On Fri, Dec 19, 2003 at 05:32:11PM +0100, Jurgen Kramer wrote:
> When I insert the longhaul cpufreq module on my VIA EPIA 800 the system
> completely freezes. It does not give any oops or other helpful error
> message.
>

Does this help ?

Dave

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/cpu/cpufreq/longhaul.c cpufreq/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- bk-linus/arch/i386/kernel/cpu/cpufreq/longhaul.c 2003-10-15 05:00:29.000000000 +0100
+++ cpufreq/arch/i386/kernel/cpu/cpufreq/longhaul.c 2003-11-21 02:20:59.000000000 +0000
@@ -170,6 +170,9 @@ static void longhaul_setstate (unsigned
* between that value multiplied by possible FSBs and cpu_mhz which
* was calculated at boot time. Really ugly, but no other way to do this.
*/
+
+#define ROUNDING 0xf
+
static int _guess (int guess, int maxmult)
{
int target;
@@ -177,16 +180,20 @@ static int _guess (int guess, int maxmul
target = ((maxmult/10)*guess);
if (maxmult%10 != 0)
target += (guess/2);
- target &= ~0xf;
+ target += ROUNDING/2;
+ target &= ~ROUNDING;
return target;
}

static int guess_fsb(int maxmult)
{
- int speed = (cpu_khz/1000) & ~0xf;
+ int speed = (cpu_khz/1000);
int i;
int speeds[3] = { 66, 100, 133 };

+ speed += ROUNDING/2;
+ speed &= ~ROUNDING;
+
for (i=0; i<3; i++) {
if (_guess(speeds[i],maxmult) == speed)
return speeds[i];

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/