public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Jurgen Kramer <gtm.kramer@inter.nl.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.6.0 cpufreq] longhaul trouble
Date: Fri, 19 Dec 2003 18:04:06 +0000	[thread overview]
Message-ID: <20031219180406.GA24413@redhat.com> (raw)
In-Reply-To: <1071851531.9835.5.camel@paragon.slim>

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];


  reply	other threads:[~2003-12-19 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-19 16:32 [2.6.0 cpufreq] longhaul trouble Jurgen Kramer
2003-12-19 18:04 ` Dave Jones [this message]
2003-12-20 10:13   ` Jurgen Kramer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031219180406.GA24413@redhat.com \
    --to=davej@redhat.com \
    --cc=gtm.kramer@inter.nl.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox