All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@brodo.de>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Cc: hpa@zytor.com, cpufreq@www.linux.org.uk, hugang@soulinfo.com
Subject: [PATCH] Re: [2.5.39] (3/5) CPUfreq i386 drivers
Date: Sat, 28 Sep 2002 13:44:57 +0200	[thread overview]
Message-ID: <20020928134457.A14784@brodo.de> (raw)
In-Reply-To: <20020928112503.E1217@brodo.de>; from linux@brodo.de on Sat, Sep 28, 2002 at 11:25:03AM +0200

This add-on patch is needed to abort on Dell Inspiron 8000 / 8100 which
would lock up during speedstep.c and to resolve an oops (thanks to Hu Gang
for reporting this)

	Dominik

--- linux/arch/i386/kernel/cpu/cpufreq/speedstep.c.original	Sat Sep 28 12:28:14 2002
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep.c	Sat Sep 28 12:32:04 2002
@@ -288,9 +288,32 @@
 			      PCI_ANY_ID,
 			      PCI_ANY_ID,
 			      NULL);
-	if (speedstep_chipset_dev)
-		return SPEEDSTEP_CHIPSET_ICH2M;
+	if (speedstep_chipset_dev) {
+		/* speedstep.c causes lockups on Dell Inspirons 8000 and
+		 * 8100 which use a pretty old revision of the 82815 
+		 * host brige. Abort on these systems.
+		 */
+		static struct pci_dev   *hostbridge;
+		u8			rev = 0;
+
+		hostbridge  = pci_find_subsys(PCI_VENDOR_ID_INTEL,
+			      PCI_DEVICE_ID_INTEL_82815_MC,
+			      PCI_ANY_ID,
+			      PCI_ANY_ID,
+			      NULL);
+
+		if (!hostbridge)
+			return SPEEDSTEP_CHIPSET_ICH2M;
+			
+		pci_read_config_byte(hostbridge, PCI_REVISION_ID, &rev);
+		if (rev < 5) {
+			dprintk(KERN_INFO "cpufreq: hostbrige does not support speedstep\n");
+			speedstep_chipset_dev = NULL;
+			return 0;
+		}
 
+		return SPEEDSTEP_CHIPSET_ICH2M;
+	}
 
 	return 0;
 }
@@ -504,6 +527,7 @@
 static int speedstep_detect_speeds (void)
 {
 	unsigned int    state;
+	unsigned int    low = 0, high = 0;
 	int             i, result;
     
 	for (i=0; i<2; i++) {
@@ -517,29 +541,32 @@
 			switch (speedstep_processor) {
 			case SPEEDSTEP_PROCESSOR_PIII_C:
 			case SPEEDSTEP_PROCESSOR_PIII_T:
-				speedstep_low_freq = pentium3_get_frequency();
+				low = pentium3_get_frequency();
 				break;
 			case SPEEDSTEP_PROCESSOR_P4M:
-				speedstep_low_freq = pentium4_get_frequency();
+				low = pentium4_get_frequency();
 			}
 			speedstep_set_state(SPEEDSTEP_HIGH);
 		} else {
 			switch (speedstep_processor) {
 			case SPEEDSTEP_PROCESSOR_PIII_C:
 			case SPEEDSTEP_PROCESSOR_PIII_T:
-				speedstep_high_freq = pentium3_get_frequency();
+				high = pentium3_get_frequency();
 				break;
 			case SPEEDSTEP_PROCESSOR_P4M:
-				speedstep_high_freq = pentium4_get_frequency();
+				high = pentium4_get_frequency();
 			}
 			speedstep_set_state(SPEEDSTEP_LOW);
 		}
 
-		if (!speedstep_low_freq || !speedstep_high_freq || 
+		if (!low || !high || 
 		    (speedstep_low_freq == speedstep_high_freq))
 			return -EIO;
 	}
 
+	speedstep_low_freq = low;
+	speedstep_high_freq = high;
+
 	return 0;
 }
 
@@ -632,6 +659,8 @@
 		return result;
 
 	/* detect low and high frequency */
+	speedstep_low_freq = 100000;
+	speedstep_high_freq = 200000;
 	result = speedstep_detect_speeds();
 	if (result)
 		return result;




  reply	other threads:[~2002-09-28 11:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28  9:25 [2.5.39] (3/5) CPUfreq i386 drivers Dominik Brodowski
2002-09-28 11:44 ` Dominik Brodowski [this message]
2002-09-28 17:47   ` [PATCH] " Gerald Britton
2002-09-29  9:16     ` Dominik Brodowski
2002-09-29 10:10       ` Dominik Brodowski
2002-09-29 19:56         ` Gerald Britton
2002-09-29 23:39           ` Dominik Brodowski
2002-09-30  1:01             ` Gerald Britton
2002-09-30  0:59           ` Horst von Brand
2002-09-28 22:03   ` Toon van der Pas
2002-09-29  8:38     ` Dominik Brodowski
2002-09-29 14:44       ` Toon van der Pas

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=20020928134457.A14784@brodo.de \
    --to=linux@brodo.de \
    --cc=cpufreq@www.linux.org.uk \
    --cc=hpa@zytor.com \
    --cc=hugang@soulinfo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.