All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 1/2] k8temp warn about errata
@ 2008-10-01 22:09 Rudolf Marek
  2008-10-25 12:43 ` Jean Delvare
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Rudolf Marek @ 2008-10-01 22:09 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Following patch adds warning about wrong CPU temperature readouts on all fam f
rev f revision of CPUs.

Used switch statement, more code changes follows.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>

It should "fix" http://bugzilla.kernel.org/show_bug.cgi?id=8866

Rudolf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI4/UF3J9wPJqZRNURAmtlAJ9+mLtSfm0pm5mPYM64KAJlkqNJSACfeUd/
E/rMMMRv+fY550oVBxk3lF4=
=zqkq
-----END PGP SIGNATURE-----

[-- Attachment #2: k8temp_add_warning.patch --]
[-- Type: text/x-diff, Size: 1356 bytes --]

Index: linux-2.6.27-rc7/drivers/hwmon/k8temp.c
===================================================================
--- linux-2.6.27-rc7.orig/drivers/hwmon/k8temp.c	2008-09-28 11:01:45.855284456 +0200
+++ linux-2.6.27-rc7/drivers/hwmon/k8temp.c	2008-09-28 11:13:42.396117790 +0200
@@ -34,6 +34,7 @@
 
 #define TEMP_FROM_REG(val)	(((((val) >> 16) & 0xff) - 49) * 1000)
 #define REG_TEMP	0xe4
+#define REG_CPUID	0xfc
 #define SEL_PLACE	0x40
 #define SEL_CORE	0x04
 
@@ -47,6 +48,7 @@
 	/* registers values */
 	u8 sensorsp;		/* sensor presence bits - SEL_CORE & SEL_PLACE */
 	u32 temp[2][2];		/* core, place */
+	u8 fam;
 };
 
 static struct k8temp_data *k8temp_update_device(struct device *dev)
@@ -141,6 +143,7 @@
 	int err;
 	u8 scfg;
 	u32 temp;
+
 	struct k8temp_data *data;
 	u32 cpuid = cpuid_eax(1);
 
@@ -155,6 +158,18 @@
 		goto exit;
 	}
 
+	/* get real PCI based cpuid, prior revF of fam 0Fh, this reg is 0 */
+	pci_read_config_dword(pdev, REG_CPUID, &cpuid);
+
+	data->fam = (cpuid & 0x00000f00) >> 8;
+	data->fam += (cpuid & 0x00f00000) >> 20;
+
+	switch (data->fam) {
+		case 0xf:
+			dev_warn(&pdev->dev, "Temperature readouts might be wrong"
+						" - check errata #141\n");
+	}
+
 	pci_read_config_byte(pdev, REG_TEMP, &scfg);
 	scfg &= ~(SEL_PLACE | SEL_CORE);		/* Select sensor 0, core0 */
 	pci_write_config_byte(pdev, REG_TEMP, scfg);

[-- Attachment #3: k8temp_add_warning.patch.sig --]
[-- Type: application/octet-stream, Size: 65 bytes --]

[-- Attachment #4: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2008-11-18 18:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01 22:09 [lm-sensors] [PATCH 1/2] k8temp warn about errata Rudolf Marek
2008-10-25 12:43 ` Jean Delvare
2008-10-27  1:18 ` Jean-Marc Spaggiari
2008-11-09 19:56 ` Rudolf Marek
2008-11-09 20:47 ` Jean Delvare
2008-11-09 20:54 ` Jean Delvare
2008-11-10  1:27 ` Jordan Crouse
2008-11-10  9:38 ` Jean Delvare
2008-11-18  8:41 ` Andreas Herrmann
2008-11-18  8:55 ` Andreas Herrmann
2008-11-18  9:06 ` Jean Delvare
2008-11-18  9:25 ` Andreas Herrmann
2008-11-18 10:10 ` Andreas Herrmann
2008-11-18 10:40 ` Jean Delvare
2008-11-18 11:18 ` Andreas Herrmann
2008-11-18 11:26 ` Andreas Herrmann
2008-11-18 12:33 ` Jean Delvare
2008-11-18 12:57 ` Jean Delvare
2008-11-18 17:46 ` Jordan Crouse
2008-11-18 18:15 ` Jean Delvare

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.