All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] Backporting coretemp and w83793 to 2.6.18
@ 2007-08-22  1:29 Boleslaw Ciesielski
  2007-08-22  2:38 ` Boleslaw Ciesielski
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Boleslaw Ciesielski @ 2007-08-22  1:29 UTC (permalink / raw)
  To: lm-sensors

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

Hi,

I am new to this list and hopefully this is not too stupid...

I have this new server based on the Asus DSBF-DE/SAS motherboard and a
pair of Xeons 5355. I want to run CentOS 5.0 (RHEL 5 clone) on it.
CentOS 5.0 is based on the 2.6.18 kernel and as such has drivers for
everything *except* for the sensors. The motherboard uses 83793 chip.

So, I wanted to backport the w83793 and coretemp drivers to 2.6.18
kernel. I took the source from 2.6.22.3 for these two and tried to
compile them for 2.6.18.

The w83793 compiles and loads as is, without any changes.

coretemp required some changes related to msr so I just restored the
code that was in there when coretemp was floating around as a patch
before it made it to the kernel. See the attached patch for detail.

Anyway, with those changes both coretemp and w83793 compile and load. I
also copied sensors.conf from 2.10.4 and ran "sensors -s". However,
neither is providing any data. Output looks like this:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter

coretemp-isa-0001
Adapter: ISA adapter

coretemp-isa-0002
Adapter: ISA adapter

coretemp-isa-0003
Adapter: ISA adapter

coretemp-isa-0004
Adapter: ISA adapter

coretemp-isa-0005
Adapter: ISA adapter

coretemp-isa-0006
Adapter: ISA adapter

coretemp-isa-0007
Adapter: ISA adapter

w83793-i2c-0-2f
Adapter: SMBus I801 adapter at 1100


$

Am I missing something obvious? I did verify that I can get good sensor 
reading on this motherboard using Fedora 7 and 2.6.22 kernel but that's 
not what I want to run in production.

Any help will be appreciated.

Thanks,

Bolek


[-- Attachment #2: coretemp-2.6.18.patch --]
[-- Type: text/x-patch, Size: 3225 bytes --]

--- /tmp/linux-2.6.22.3/drivers/hwmon/coretemp.c	2007-08-15 12:25:39.000000000 -0400
+++ drivers/hwmon/coretemp.c	2007-08-21 20:50:38.000000000 -0400
@@ -36,6 +36,71 @@
 #include <asm/msr.h>
 #include <asm/processor.h>
 
+/*
+   Following part ripped from the msr.c. It should be merged with generic MSR
+   infrastructure (once ready)
+*/
+
+static inline int rdmsr_eio(u32 reg, u32 *eax, u32 *edx)
+{
+	int err;
+
+	err = rdmsr_safe(reg, eax, edx);
+	if (err)
+		err = -EIO;
+	return err;
+}
+
+#ifdef CONFIG_SMP
+
+struct msr_command {
+	int cpu;
+	int err;
+	u32 reg;
+	u32 data[2];
+};
+
+static void msr_smp_rdmsr(void *cmd_block)
+{
+	struct msr_command *cmd = (struct msr_command *)cmd_block;
+
+	if (cmd->cpu == smp_processor_id())
+		cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]);
+}
+
+static inline int msr_read(int cpu, u32 reg, u32 * eax, u32 * edx)
+{
+	struct msr_command cmd;
+	int ret;
+
+	preempt_disable();
+	if (cpu == smp_processor_id()) {
+		ret = rdmsr_eio(reg, eax, edx);
+	} else {
+		cmd.cpu = cpu;
+		cmd.reg = reg;
+
+		smp_call_function(msr_smp_rdmsr, &cmd, 1, 1);
+
+		*eax = cmd.data[0];
+		*edx = cmd.data[1];
+
+		ret = cmd.err;
+	}
+	preempt_enable();
+	return ret;
+}
+
+#else				/* ! CONFIG_SMP */
+
+static inline int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx)
+{
+	return rdmsr_eio(reg, eax, edx);
+}
+
+#endif				/* ! CONFIG_SMP */
+
+
 #define DRVNAME	"coretemp"
 
 typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW;
@@ -132,7 +197,7 @@
 		u32 eax, edx;
 
 		data->valid = 0;
-		rdmsr_on_cpu(data->id, MSR_IA32_THERM_STATUS, &eax, &edx);
+		msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx);
 		data->alarm = (eax >> 5) & 1;
 		/* update only if data has been valid */
 		if (eax & 0x80000000) {
@@ -169,7 +234,7 @@
 	data->tjmax = 100000;
 
 	/* test if we can access the THERM_STATUS MSR */
-	err = rdmsr_safe_on_cpu(data->id, MSR_IA32_THERM_STATUS, &eax, &edx);
+	err = msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx);
 	if (err) {
 		dev_err(&pdev->dev,
 			"Unable to access THERM_STATUS MSR, giving up\n");
@@ -183,7 +248,7 @@
 
 	if ((c->x86_model == 0xe) && (c->x86_mask < 0xc)) {
 		/* check for microcode update */
-		rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
+		msr_read(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
 		if (edx < 0x39) {
 			err = -ENODEV;
 			dev_err(&pdev->dev,
@@ -200,7 +265,7 @@
 
 	if (((c->x86_model == 0xf) && (c->x86_mask > 3)) ||
 		(c->x86_model == 0xe))  {
-		err = rdmsr_safe_on_cpu(data->id, 0xee, &eax, &edx);
+		err = msr_read(data->id, 0xee, &eax, &edx);
 		if (err) {
 			dev_warn(&pdev->dev,
 				 "Unable to access MSR 0xEE, Tjmax left at %d "
@@ -216,7 +281,7 @@
 	   bit 50 of MSR_IA32_PLATFORM_ID should be 0.
 	*/
 
-	rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);
+	msr_read(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);
 
 	if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) {
 		dev_warn(&pdev->dev, "Using undocumented features, absolute "
@@ -339,11 +404,9 @@
 
 	switch (action) {
 	case CPU_ONLINE:
-	case CPU_ONLINE_FROZEN:
 		coretemp_device_add(cpu);
 		break;
 	case CPU_DEAD:
-	case CPU_DEAD_FROZEN:
 		coretemp_device_remove(cpu);
 		break;
 	}


[-- Attachment #3: 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] 6+ messages in thread

* Re: [lm-sensors] Backporting coretemp and w83793 to 2.6.18
  2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
@ 2007-08-22  2:38 ` Boleslaw Ciesielski
  2008-05-05 17:05 ` Darth Tumi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Boleslaw Ciesielski @ 2007-08-22  2:38 UTC (permalink / raw)
  To: lm-sensors

Boleslaw Ciesielski wrote:
> I have this new server based on the Asus DSBF-DE/SAS motherboard and a
> pair of Xeons 5355. I want to run CentOS 5.0 (RHEL 5 clone) on it.
> CentOS 5.0 is based on the 2.6.18 kernel and as such has drivers for
> everything *except* for the sensors. The motherboard uses 83793 chip.
> 
> So, I wanted to backport the w83793 and coretemp drivers to 2.6.18
> kernel. I took the source from 2.6.22.3 for these two and tried to
> compile them for 2.6.18.
> 
> The w83793 compiles and loads as is, without any changes.
> 
> coretemp required some changes related to msr so I just restored the
> code that was in there when coretemp was floating around as a patch
> before it made it to the kernel. See the attached patch for detail.
> 
> Anyway, with those changes both coretemp and w83793 compile and load. I
> also copied sensors.conf from 2.10.4 and ran "sensors -s". However,
> neither is providing any data. Output looks like this:

Just a quick update. I got reply off-list that I am missing the new 
versions of the user tools. I installed 2.10.4 rpm from Fedora 7 and I 
get the readings now.

Thank you

Bolek

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

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

* [lm-sensors]  Backporting coretemp and w83793 to 2.6.18
  2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
  2007-08-22  2:38 ` Boleslaw Ciesielski
@ 2008-05-05 17:05 ` Darth Tumi
  2008-05-05 17:16 ` Darth Tumi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Darth Tumi @ 2008-05-05 17:05 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 516 bytes --]

Hi,

 

I have the same problema as you reported (the only difference is that my
system is a x64 Cent OS 5.1, board Supermicro X7DBR-3 (Winbond W83793G),
kernel 2.6.18-53.1.14.el5.

 

We need that kernel version and I’m blocked because I have absolutly no
experience in compiling and installing drivers… so can you send me those
compiled by you or detailed instructions or references for compiling and
installing them?

 

Thank you in advance, sorry if my request is too silly.

Regards

 


[-- Attachment #1.2: Type: text/html, Size: 4077 bytes --]

[-- Attachment #2: 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] 6+ messages in thread

* [lm-sensors]   Backporting coretemp and w83793 to 2.6.18
  2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
  2007-08-22  2:38 ` Boleslaw Ciesielski
  2008-05-05 17:05 ` Darth Tumi
@ 2008-05-05 17:16 ` Darth Tumi
  2008-05-12 12:37 ` Jean Delvare
  2008-05-12 13:22 ` Darth Tumi
  4 siblings, 0 replies; 6+ messages in thread
From: Darth Tumi @ 2008-05-05 17:16 UTC (permalink / raw)
  To: lm-sensors

Sorry, this question is about one archived post
(http://lists.lm-sensors.org/pipermail/lm-sensors/2007-August/021007.html)
by Boleslaw Ciesielski... (bellow)

Any help will be appreciated.

> Boleslaw Ciesielski wrote:
> > I have this new server based on the Asus DSBF-DE/SAS motherboard and a
> > pair of Xeons 5355. I want to run CentOS 5.0 (RHEL 5 clone) on it.
> > CentOS 5.0 is based on the 2.6.18 kernel and as such has drivers for
> > everything *except* for the sensors. The motherboard uses 83793 chip.
> > 
> > So, I wanted to backport the w83793 and coretemp drivers to 2.6.18
> > kernel. I took the source from 2.6.22.3 for these two and tried to
> > compile them for 2.6.18.
> > 
> > The w83793 compiles and loads as is, without any changes.
> > 
> > coretemp required some changes related to msr so I just restored the
> > code that was in there when coretemp was floating around as a patch
> > before it made it to the kernel. See the attached patch for detail.
> > 
> > Anyway, with those changes both coretemp and w83793 compile and load. I
> > also copied sensors.conf from 2.10.4 and ran "sensors -s". However,
> > neither is providing any data. Output looks like this:
> 
> Just a quick update. I got reply off-list that I am missing the new 
> versions of the user tools. I installed 2.10.4 rpm from Fedora 7 and I 
> get the readings now.
> 
> Thank you
> 
> Bolek





 

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas
de virus 3071 (20080502) __________

ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
 


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

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

* Re: [lm-sensors] Backporting coretemp and w83793 to 2.6.18
  2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
                   ` (2 preceding siblings ...)
  2008-05-05 17:16 ` Darth Tumi
@ 2008-05-12 12:37 ` Jean Delvare
  2008-05-12 13:22 ` Darth Tumi
  4 siblings, 0 replies; 6+ messages in thread
From: Jean Delvare @ 2008-05-12 12:37 UTC (permalink / raw)
  To: lm-sensors

On Mon, 5 May 2008 19:05:27 +0200, Darth Tumi wrote:
> I have the same problema as you reported (the only difference is that my
> system is a x64 Cent OS 5.1, board Supermicro X7DBR-3 (Winbond W83793G),
> kernel 2.6.18-53.1.14.el5.
> 
> We need that kernel version and I'm blocked because I have absolutly no
> experience in compiling and installing drivers so can you send me those
> compiled by you or detailed instructions or references for compiling and
> installing them?

I happen to have backported the w83793 driver to kernel 2.6.18 for a
friend of mine already. You can pick it from:
http://jdelvare.pck.nerim.net/sensors/w83793/

In order to build it, you'll need the usual tools (gcc, make) and the
kernel sources matching your running kernel. Just running "make" should
build the w83793 driver, and "make modules_install" as root should
install it. Then all you have to do is "modprobe w83793".

-- 
Jean Delvare

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

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

* Re: [lm-sensors] Backporting coretemp and w83793 to 2.6.18
  2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
                   ` (3 preceding siblings ...)
  2008-05-12 12:37 ` Jean Delvare
@ 2008-05-12 13:22 ` Darth Tumi
  4 siblings, 0 replies; 6+ messages in thread
From: Darth Tumi @ 2008-05-12 13:22 UTC (permalink / raw)
  To: lm-sensors

Great!
Thanks a lot

-----Mensaje original-----
De: Jean Delvare [mailto:khali@linux-fr.org] 
Enviado el: lunes, 12 de mayo de 2008 14:38
Para: Darth Tumi
CC: lm-sensors@lm-sensors.org
Asunto: Re: [lm-sensors] Backporting coretemp and w83793 to 2.6.18

On Mon, 5 May 2008 19:05:27 +0200, Darth Tumi wrote:
> I have the same problema as you reported (the only difference is that my
> system is a x64 Cent OS 5.1, board Supermicro X7DBR-3 (Winbond W83793G),
> kernel 2.6.18-53.1.14.el5.
> 
> We need that kernel version and I'm blocked because I have absolutly no
> experience in compiling and installing drivers so can you send me those
> compiled by you or detailed instructions or references for compiling and
> installing them?

I happen to have backported the w83793 driver to kernel 2.6.18 for a
friend of mine already. You can pick it from:
http://jdelvare.pck.nerim.net/sensors/w83793/

In order to build it, you'll need the usual tools (gcc, make) and the
kernel sources matching your running kernel. Just running "make" should
build the w83793 driver, and "make modules_install" as root should
install it. Then all you have to do is "modprobe w83793".

-- 
Jean Delvare
 

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas
de virus 3092 (20080512) __________

ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
 
 

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas
de virus 3092 (20080512) __________

ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
 


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

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

end of thread, other threads:[~2008-05-12 13:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-22  1:29 [lm-sensors] Backporting coretemp and w83793 to 2.6.18 Boleslaw Ciesielski
2007-08-22  2:38 ` Boleslaw Ciesielski
2008-05-05 17:05 ` Darth Tumi
2008-05-05 17:16 ` Darth Tumi
2008-05-12 12:37 ` Jean Delvare
2008-05-12 13:22 ` Darth Tumi

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.