Skip to contentSkip to conversation

hwmon: (coretemp) Fix oops on driver load

PATCH In review Jean Delvare 4 participants 11 messages Dec 1, 2011 – Dec 14, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (coretemp) Fix oops on driver load

Quoted 7 lines · Jean Delvare
Quoted 5 lines · undersys

Hi All,

I can no longer load the core temp module, it gives me the following kernel Opps. (...)
This used to work fine before I updated the kernel to 3.0.x. (...)

Quoted 6 lines

Ah, yes, I can reproduce that, and the bug is pretty obvious. I'll send a patch tomorrow.

Meanwhile you may be able to work around the problem by installing the microcode_ctl package and ensuring that the microcode is updated before loading the coretemp driver.

If the CPU microcode is too old, the coretemp driver won't work. But instead of failing gracefully, it currently oops. Check for NULL platform device data to avoid this.

Cc Fenghua Yu <[email protected]>
Cc Durgadoss R <[email protected]>
Cc Guenter Roeck <[email protected]>

---
This is for stable kernel branch 3.0 only. Previous and later versions have different code paths and are not affected by this bug.

 drivers/hwmon/coretemp.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/hwmon/coretemp.c +2 -0
@@ -539,6 +539,8 @@ static void coretemp_add_core(unsigned i
 		return;
 
 	pdata = platform_get_drvdata(pdev);
+	if (!pdata)
+		return;
 
 	err = create_core_data(pdata, pdev, cpu, pkg_flag);
 	if (err)
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw

Thanks Jean for the fix.

Quoted 3 lines

If the CPU microcode is too old, the coretemp driver won't work. But instead of failing gracefully, it currently oops. Check for NULL platform device data to avoid this.

Thanks,
Durga

Quoted 25 lines
Cc Fenghua Yu <[email protected]>
Cc Durgadoss R <[email protected]>
Cc Guenter Roeck <[email protected]>

---
This is for stable kernel branch 3.0 only. Previous and later versions have different code paths and are not affected by this bug.

 drivers/hwmon/coretemp.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-3.0.orig/drivers/hwmon/coretemp.c 2011-12-01 08:39:45.000000000
+0100
+++ linux-3.0/drivers/hwmon/coretemp.c 2011-12-01 08:49:32.000000000 +0100

drivers/hwmon/coretemp.c +2 -1
@@ -539,6 +539,8 @@ static void coretemp_add_core(unsigned i
 		return;
 
 	pdata = platform_get_drvdata(pdev);
+	if (!pdata)
+		return;
 
 	err = create_core_data(pdata, pdev, cpu, pkg_flag);
 	if (err)
 
--
Quoted 1 line

Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Acked-by on v1 1/1
#2 lore raw
In reply to Jean Delvare
Quoted 15 lines · Jean Delvare
Quoted 7 lines · Jean Delvare
Quoted 5 lines · undersys

Hi All,

I can no longer load the core temp module, it gives me the following kernel Opps. (...)
This used to work fine before I updated the kernel to 3.0.x. (...)

Quoted 6 lines

Ah, yes, I can reproduce that, and the bug is pretty obvious. I'll send a patch tomorrow.

Meanwhile you may be able to work around the problem by installing the microcode_ctl package and ensuring that the microcode is updated before loading the coretemp driver.

Quoted 8 lines

If the CPU microcode is too old, the coretemp driver won't work. But instead of failing gracefully, it currently oops. Check for NULL platform device data to avoid this.

Cc Fenghua Yu <[email protected]>
Cc Durgadoss R <[email protected]>
Cc Guenter Roeck <[email protected]>

Jean, how do we send this to Greg ? [email protected] ?

Guenter

Quoted 11 lines

---
This is for stable kernel branch 3.0 only. Previous and later versions have different code paths and are not affected by this bug.

 drivers/hwmon/coretemp.c |    2 ++
 1 file changed, 2 insertions(+)

drivers/hwmon/coretemp.c static void coretemp_add_core(unsigned i · line 546

Quoted 8 lines
drivers/hwmon/coretemp.c +2 -0
@@ -539,6 +539,8 @@ static void coretemp_add_core(unsigned i
 		return;
 
 	pdata = platform_get_drvdata(pdev);
+	if (!pdata)
+		return;
 
 	err = create_core_data(pdata, pdev, cpu, pkg_flag);
 	if (err)

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Jean Delvare
Quoted 20 lines · Guenter Roeck
Quoted 19 lines · Jean Delvare
Quoted 7 lines · Jean Delvare
Quoted 5 lines · undersys

Hi All,

I can no longer load the core temp module, it gives me the following kernel Opps. (...)
This used to work fine before I updated the kernel to 3.0.x. (...)

Quoted 6 lines

Ah, yes, I can reproduce that, and the bug is pretty obvious. I'll send a patch tomorrow.

Meanwhile you may be able to work around the problem by installing the microcode_ctl package and ensuring that the microcode is updated before loading the coretemp driver.

If the CPU microcode is too old, the coretemp driver won't work. But instead of failing gracefully, it currently oops. Check for NULL platform device data to avoid this.

Quoted 5 lines
Quoted 4 lines
Cc Fenghua Yu <[email protected]>
Cc Durgadoss R <[email protected]>
Cc Guenter Roeck <[email protected]>

Thanks.

Quoted 1 line

Jean, how do we send this to Greg ? [email protected] ?

Yes. I'll do so right now.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#4 lore raw
In reply to Jean Delvare

----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "guenter roeck" <[email protected]>
Cc: [email protected], [email protected], "Durgadoss R" <[email protected]>
Sent: Friday, 2 December, 2011 12:19:25 AM
Subject: Re: [PATCH] hwmon: (coretemp) Fix oops on driver load

Quoted 20 lines · Guenter Roeck
Quoted 19 lines · Jean Delvare
Quoted 7 lines · Jean Delvare
Quoted 5 lines · undersys

Hi All,

I can no longer load the core temp module, it gives me the following kernel Opps. (...)
This used to work fine before I updated the kernel to 3.0.x. (...)

Quoted 6 lines

Ah, yes, I can reproduce that, and the bug is pretty obvious. I'll send a patch tomorrow.

Meanwhile you may be able to work around the problem by installing the microcode_ctl package and ensuring that the microcode is updated before loading the coretemp driver.

If the CPU microcode is too old, the coretemp driver won't work. But instead of failing gracefully, it currently oops. Check for NULL platform device data to avoid this.

Quoted 5 lines
Quoted 4 lines
Cc Fenghua Yu <[email protected]>
Cc Durgadoss R <[email protected]>
Cc Guenter Roeck <[email protected]>

Thanks.

Quoted 1 line

Jean, how do we send this to Greg ? [email protected] ?

Yes. I'll do so right now.

Signature · 12 lines
Jean Delvare

I've now got the latest microcode from Intel loading fine.
The coretemp module still will case an "OPPS" but the new code will solve that
from what i understand but it also still means that coretemp no longer pics up my CPU temp..

Thanks

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#5 lore raw
In reply to Jean Delvare
Quoted 3 lines · undersys

I've now got the latest microcode from Intel loading fine.
The coretemp module still will case an "OPPS" but the new code will solve that from what i understand but it also still means that coretemp no longer pics up my CPU temp..

Odd. Which microcode package version are you running? What's your exact CPU family/model/stepping?
Did you get the coretemp driver to work for this CPU with any kernel version in the 2.6.22 to 2.6.39 range?

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#6 lore raw
In reply to Jean Delvare

----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: [email protected]
Cc: [email protected], "Durgadoss R" <[email protected]>, "guenter roeck" <[email protected]>
Sent: Tuesday, 6 December, 2011 1:02:54 AM
Subject: Re: [PATCH] hwmon: (coretemp) Fix oops on driver load

Quoted 3 lines · undersys

I've now got the latest microcode from Intel loading fine.
The coretemp module still will case an "OPPS" but the new code will solve that from what i understand but it also still means that coretemp no longer pics up my CPU temp..

Odd. Which microcode package version are you running? What's your exact CPU family/model/stepping?
Did you get the coretemp driver to work for this CPU with any kernel version in the 2.6.22 to 2.6.39 range?

Signature · 20 lines
Jean Delvare

The microcode utility I am using is :-
http://urbanmyth.org/microcode

The version of micro code I am using is "microcode-20110915.tgz" :-
http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID 429&lang=eng

CPU is :-
Intel Xeon sossaman, model, stepping=4. 
I don't have the SPEC number on hand let me know if you need more information.

Micro code was working on 2.6.29 and 2.6.39 , then I jumped to 3.0.6.

Thanks for your help

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#7 lore raw
In reply to Jean Delvare
Quoted 5 lines · undersys

The microcode utility I am using is :-
http://urbanmyth.org/microcode

The version of micro code I am using is "microcode-20110915.tgz" :-
http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID 429&lang=eng

Did you have to do that with previous kernels too?

Quoted 3 lines

CPU is :-
Intel Xeon sossaman, model, stepping=4.
I don't have the SPEC number on hand let me know if you need more information.

Is this a single or multi-cpu system?

I would like to see the contents of /proc/cpuinfo.

Quoted 1 line

Micro code was working on 2.6.29 and 2.6.39 , then I jumped to 3.0.6.

I admit I don't quite get it for now. While the device probing logic was modified a lot in the coretemp driver of kernel 3.0, the microcode check did not change, so I just don't get why the new driver would behave differently from the previous ones in this respect.

For testing purposes, I made the 2.6.39 version of the coretemp driver available as a standalone driver:
http://khali.linux-fr.org/devel/misc/coretemp_old/
(Instructions at http://khali.linux-fr.org/devel/misc/INSTALL )

I would like you to test it on your 3.0 kernel and report whether it is working or not. You'll have to rmmod the original coretemp driver before loading coretemp_old, you can't have both loaded at once.

If coretemp_old works, then please rmmod it and modprobe coretemp again, and see if it then works.

Signature · 7 lines
Jean Delvare
http://khali.linux-fr.org/wishlist.html

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#8 lore raw
In reply to Jean Delvare

----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: [email protected]
Cc: [email protected], "Durgadoss R" <[email protected]>, "guenter roeck" <[email protected]>
Sent: Tuesday, 6 December, 2011 5:53:41 PM
Subject: Re: [PATCH] hwmon: (coretemp) Fix oops on driver load

Quoted 5 lines · undersys

The microcode utility I am using is :-
http://urbanmyth.org/microcode

The version of micro code I am using is "microcode-20110915.tgz" :-
http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=20429&lang=eng

Did you have to do that with previous kernels too?

undersys -> I Did not ever need to use the microcode utility.
Maybe i should in future...

Quoted 3 lines

CPU is :-
Intel Xeon sossaman, model=14, stepping=4.
I don't have the SPEC number on hand let me know if you need more information.

Is this a single or multi-cpu system?

undersys -> multi-cpu (dual socket)

I would like to see the contents of /proc/cpuinfo.

undersys -> attached

Quoted 1 line

Micro code was working on 2.6.29 and 2.6.39 , then I jumped to 3.0.6.

I admit I don't quite get it for now. While the device probing logic was modified a lot in the coretemp driver of kernel 3.0, the microcode check did not change, so I just don't get why the new driver would behave differently from the previous ones in this respect.

For testing purposes, I made the 2.6.39 version of the coretemp driver available as a standalone driver:
http://khali.linux-fr.org/devel/misc/coretemp_old/
(Instructions at http://khali.linux-fr.org/devel/misc/INSTALL )

I would like you to test it on your 3.0 kernel and report whether it is working or not. You'll have to rmmod the original coretemp driver before loading coretemp_old, you can't have both loaded at once.

If coretemp_old works, then please rmmod it and modprobe coretemp again, and see if it then works.

undersys ->

I built your module(coretemp_old), works fine no kernel opps. The only lines printed to "dmesg" are :-

[  133.603204] coretemp coretemp.0: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603277] coretemp coretemp.1: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603329] coretemp coretemp.2: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603379] coretemp coretemp.3: Errata AE18 not fixed, update BIOS or microcode of the CPU!

If i remove it and then attempt to re-probe the new one, the new one fails.

Signature · 9 lines
Jean Delvare
http://khali.linux-fr.org/wishlist.html


Hi Jean,

Answers are inline.

Thanks for your time!
# cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 14
model name	: Intel(R) Dual Pentium(R) M CPU   000  @ 1.83GHz
stepping	: 4
cpu MHz		: 996.000
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 6
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc bts pni monitor vmx est tm2 xtpr dts
bogomips	: 3667.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 32 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Intel(R) Dual Pentium(R) M CPU 000 @ 1.83GHz
stepping : 4
cpu MHz : 996.000
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 0
cpu cores : 2
apicid : 6
initial apicid : 6
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc bts pni monitor vmx est tm2 xtpr dts
bogomips : 3666.16
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 32 bits virtual
power management:

processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Intel(R) Dual Pentium(R) M CPU 000 @ 1.83GHz
stepping : 4
cpu MHz : 996.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc bts pni monitor vmx est tm2 xtpr dts
bogomips : 3666.16
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 32 bits virtual
power management:

processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Intel(R) Dual Pentium(R) M CPU 000 @ 1.83GHz
stepping : 4
cpu MHz : 996.000
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 1
cpu cores : 2
apicid : 7
initial apicid : 7
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc bts pni monitor vmx est tm2 xtpr dts
bogomips : 3666.16
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 32 bits virtual
power management:

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#9 lore raw
In reply to Jean Delvare
Quoted 3 lines · undersys

I would like to see the contents of /proc/cpuinfo.

undersys -> attached

I can only confirm that this is one of the series where the microcode needs to be recent enough. No surprise here.

Quoted 21 lines
Quoted 1 line

Micro code was working on 2.6.29 and 2.6.39 , then I jumped to 3.0.6.

I admit I don't quite get it for now. While the device probing logic was modified a lot in the coretemp driver of kernel 3.0, the microcode check did not change, so I just don't get why the new driver would behave differently from the previous ones in this respect.

For testing purposes, I made the 2.6.39 version of the coretemp driver available as a standalone driver:
http://khali.linux-fr.org/devel/misc/coretemp_old/
(Instructions at http://khali.linux-fr.org/devel/misc/INSTALL )

I would like you to test it on your 3.0 kernel and report whether it is working or not. You'll have to rmmod the original coretemp driver before loading coretemp_old, you can't have both loaded at once.

If coretemp_old works, then please rmmod it and modprobe coretemp again, and see if it then works.

undersys ->

Quoted 8 lines

I built your module(coretemp_old), works fine no kernel opps. The only lines printed to "dmesg" are :-

[  133.603204] coretemp coretemp.0: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603277] coretemp coretemp.1: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603329] coretemp coretemp.2: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603379] coretemp coretemp.3: Errata AE18 not fixed, update BIOS or microcode of the CPU!

If i remove it and then attempt to re-probe the new one, the new one fails.

I'm giving up on this one. I tried reproducing on one of my systems by simulating a wrong microcode version. I obtain the same behavior for the 2.6.32, 2.6.39 and (fixed) 3.0 versions of the coretemp driver:
error message in the log, driver loads without crashing, and "sensors" show no coretemp device. So this is all as expected and I don't see any regression here, thus there is nothing for me to fix.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#10 lore raw
In reply to Jean Delvare

----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: [email protected]
Cc: [email protected], "Durgadoss R" <[email protected]>, "guenter roeck" <[email protected]>
Sent: Sunday, 11 December, 2011 8:49:50 PM
Subject: Re: [PATCH] hwmon: (coretemp) Fix oops on driver load

Quoted 3 lines · undersys

I would like to see the contents of /proc/cpuinfo.

undersys -> attached

I can only confirm that this is one of the series where the microcode needs to be recent enough. No surprise here.

Quoted 21 lines
Quoted 1 line

Micro code was working on 2.6.29 and 2.6.39 , then I jumped to 3.0.6.

I admit I don't quite get it for now. While the device probing logic was modified a lot in the coretemp driver of kernel 3.0, the microcode check did not change, so I just don't get why the new driver would behave differently from the previous ones in this respect.

For testing purposes, I made the 2.6.39 version of the coretemp driver available as a standalone driver:
http://khali.linux-fr.org/devel/misc/coretemp_old/
(Instructions at http://khali.linux-fr.org/devel/misc/INSTALL )

I would like you to test it on your 3.0 kernel and report whether it is working or not. You'll have to rmmod the original coretemp driver before loading coretemp_old, you can't have both loaded at once.

If coretemp_old works, then please rmmod it and modprobe coretemp again, and see if it then works.

undersys ->

Quoted 8 lines

I built your module(coretemp_old), works fine no kernel opps. The only lines printed to "dmesg" are :-

[  133.603204] coretemp coretemp.0: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603277] coretemp coretemp.1: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603329] coretemp coretemp.2: Errata AE18 not fixed, update BIOS or microcode of the CPU!
[  133.603379] coretemp coretemp.3: Errata AE18 not fixed, update BIOS or microcode of the CPU!

If i remove it and then attempt to re-probe the new one, the new one fails.

I'm giving up on this one. I tried reproducing on one of my systems by simulating a wrong microcode version. I obtain the same behavior for the 2.6.32, 2.6.39 and (fixed) 3.0 versions of the coretemp driver:
error message in the log, driver loads without crashing, and "sensors" show no coretemp device. So this is all as expected and I don't see any regression here, thus there is nothing for me to fix.

Signature · 14 lines
Jean Delvare

Hi Jean,

No worries. Thanks for your time spent ! For now I will go back to getting the data from the IPMI card.
It would be nice if this Xeon was oneday supported but hey :)

Thanks


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors