From: Ashley Pittman <ashley@quadrics.com>
To: cpufreq <cpufreq@www.linux.org.uk>
Subject: Patch to stop i386 longhaul from deadlocking the kernel
Date: Wed, 05 Nov 2003 15:19:30 +0000 [thread overview]
Message-ID: <1068045570.23318.34.camel@ashley> (raw)
Hi,
I've had some problems with the 'longhaul' driver deadlocking my kernel
when the module is inserted. I tracked this down to the module failing
to discover the fsb speed.
This patch stops the deadlock in the case where the speed of the fsb is
undetected. I've also made the guess function more vague so it can
detect the correct speed for my cpu, it might need to be even more vague
for other cpu's.
I am still unable to change the CPU speed even with this patch however.
The problem arrived in about the -test6 timeframe and still exists in
the latest test9 I've tested. The motherboard is a mini-itx from via
running at 800.261 Mhz.
The relevent kernel output is:
Before:
longhaul: VIA C3 'Ezra' [C5C] CPU detected. Longhaul v1 supported.
longhaul: MinMult=3.0x MaxMult=6.0x
longhaul: FSB: 0MHz Lowestspeed=0MHz Highestspeed=0MHz
At this point the whole system would lock solid.
After:
longhaul: VIA C3 'Ezra' [C5C] CPU detected. Longhaul v1 supported.
longhaul: MinMult=3.0x MaxMult=6.0x
longhaul: FSB: 133MHz Lowestspeed=399MHz Highestspeed=798MHz
The module is now inserted and appears in '/proc/modules'
Ashley,
diff -u linux-2.6.0-test9-dist/arch/i386/kernel/cpu/cpufreq/longhaul.c linux-2.6.0-test9/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- linux-2.6.0-test9-dist/arch/i386/kernel/cpu/cpufreq/longhaul.c 2003-10-29 18:50:54.000000000 +0000
+++ linux-2.6.0-test9/arch/i386/kernel/cpu/cpufreq/longhaul.c 2003-11-04 11:36:43.000000000 +0000
@@ -30,6 +30,9 @@
#include "longhaul.h"
+#define SPEEDKLUDGE 0xbf
+
+
#define DEBUG
#ifdef DEBUG
@@ -177,13 +180,13 @@
target = ((maxmult/10)*guess);
if (maxmult%10 != 0)
target += (guess/2);
- target &= ~0xf;
+ target &= ~SPEEDKLUDGE;
return target;
}
static int guess_fsb(int maxmult)
{
- int speed = (cpu_khz/1000) & ~0xf;
+ int speed = (cpu_khz/1000) & ~SPEEDKLUDGE;
int i;
int speeds[3] = { 66, 100, 133 };
@@ -248,6 +251,10 @@
dprintk (KERN_INFO PFX "FSB: %dMHz Lowestspeed=%dMHz Highestspeed=%dMHz\n",
fsb, lowest_speed, highest_speed);
+ if ( fsb == 0 ) {
+ return -EINVAL;
+ }
+
longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL);
if(!longhaul_table)
return -ENOMEM;
--
Ashley Pittman <ashley@quadrics.com>
next reply other threads:[~2003-11-05 15:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-05 15:19 Ashley Pittman [this message]
2003-11-20 12:46 ` Patch to stop i386 longhaul from deadlocking the kernel Dave Jones
2003-11-20 13:24 ` Ashley Pittman
2003-11-20 13:40 ` Dave Jones
2003-11-20 14:12 ` Ashley Pittman
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=1068045570.23318.34.camel@ashley \
--to=ashley@quadrics.com \
--cc=cpufreq@www.linux.org.uk \
/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