Skip to contentSkip to conversation

hwmon: (coretemp) Fix TjMax detection for

RFC PATCH Superseded Guenter Roeck 2 participants 3 messages May 31, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 hwmon: (coretemp) Fix TjMax detection for

Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf, and 0x16 from TjMax temperature adjustment, even though several of those CPUs are known to have TiMax other than 100 degrees C, and even though the code in adjust_tjmax() explicitly handles those CPUs and points to a Web document listing several of the affected CPU IDs.

Reinstate TjMax adjustment for CPUs with model ID 0xe, 0xf, and 0x16.

Cc Huaxu Wan <[email protected]>
Cc Carsten Emde <[email protected]>
Cc Valdis Kletnieks <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>
Cc Yong Wang <[email protected]>
Cc Rudolf Marek <[email protected]>

---
Reason for sending this as RFC is that I don't know if the original change to exclude the affected CPU IDs from adjustment was made on purpose or not. Please let me know if you recall the reasons for this exclusion.

 drivers/hwmon/coretemp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/coretemp.c +3 -3
index de3d246..897a257 100644
@@ -308,12 +308,12 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
 	 */
 
 	switch (c->x86_model) {
-	case 0xe:
-	case 0xf:
-	case 0x16:
 	case 0x1a:
 		dev_warn(dev, "TjMax is assumed as 100 C!\n");
 		return 100000;
+	case 0xe:
+	case 0xf:
+	case 0x16:		/* Core 2 CPUs */
 	case 0x17:
 	case 0x1c:		/* Atom CPUs */
 		return adjust_tjmax(c, id, dev);
Signature · 7 lines
1.7.3.1


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

Re: [lm-sensors] [PATCH RFC] hwmon: (coretemp) Fix TjMax detection

Hi Guenter,

Quoted 5 lines · Guenter Roeck

Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf, and 0x16 from TjMax temperature adjustment, even though several of those CPUs are known to have TiMax other than 100 degrees C, and even though the code in adjust_tjmax() explicitly handles those CPUs and points to a Web document listing several of the affected CPU IDs.

Good catch. Tested on a Core Duo T2600 (model ID 0xe), your patch gets rid of the "TjMax is assumed as 100 C!" warning message.

Quoted 1 line

Reinstate TjMax adjustment for CPUs with model ID 0xe, 0xf, and 0x16.

But then why not 0x1a as well? The documentation lists a number of Nehalem-based processors with TjMax 90 or 105°C. It seems that adjust_tjmax() would figure it out properly, so we should just call it?

What about 0x1e (Lynnfield)? It was already supported prior to Carsten's changes. I don't know when MSR_IA32_TEMPERATURE_TARGET was introduced, but again I see no reason why adjust_tjmax() wouldn't be good for Lynnfield - at least as good as blindly assuming TjMax at 100°C.

BTW, I am curious why we read MSR_IA32_TEMPERATURE_TARGET on CPU models which we know do _not_ have this MSR? This leads to a warning message in the logs. It would seem more logical to call adjust_tjmax() directly if MSR_IA32_TEMPERATURE_TARGET isn't supported.

Quoted 11 lines
Cc Huaxu Wan <[email protected]>
Cc Carsten Emde <[email protected]>
Cc Valdis Kletnieks <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>
Cc Yong Wang <[email protected]>
Cc Rudolf Marek <[email protected]>

---
Reason for sending this as RFC is that I don't know if the original change to exclude the affected CPU IDs from adjustment was made on purpose or not. Please let me know if you recall the reasons for this exclusion.

If anybody knows, that would be Carsten, as he wrote the code. Me, as the original commit description did NOT mention the change, AND we got at least one complaint about the regression, I wouldn't hesitate to apply your proposed fix. I even think it should go to [email protected].

So, this version or one covering more models, is:

Quoted 24 lines
 drivers/hwmon/coretemp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/coretemp.c +3 -3
index de3d246..897a257 100644
@@ -308,12 +308,12 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
 	 */
 
 	switch (c->x86_model) {
-	case 0xe:
-	case 0xf:
-	case 0x16:
 	case 0x1a:
 		dev_warn(dev, "TjMax is assumed as 100 C!\n");
 		return 100000;
+	case 0xe:
+	case 0xf:
+	case 0x16:		/* Core 2 CPUs */
 	case 0x17:
 	case 0x1c:		/* Atom CPUs */
 		return adjust_tjmax(c, id, dev);
Signature · 6 lines
Jean Delvare

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

Re: [lm-sensors] [PATCH RFC] hwmon: (coretemp) Fix TjMax detection

In reply to Guenter Roeck

Hi Jean,

Quoted 9 lines · Jean Delvare

Hi Guenter,

Quoted 5 lines · Guenter Roeck

Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf, and 0x16 from TjMax temperature adjustment, even though several of those CPUs are known to have TiMax other than 100 degrees C, and even though the code in adjust_tjmax() explicitly handles those CPUs and points to a Web document listing several of the affected CPU IDs.

Quoted 9 lines

Good catch. Tested on a Core Duo T2600 (model ID 0xe), your patch gets rid of the "TjMax is assumed as 100 C!" warning message.

Quoted 1 line

Reinstate TjMax adjustment for CPUs with model ID 0xe, 0xf, and 0x16.

But then why not 0x1a as well? The documentation lists a number of Nehalem-based processors with TjMax 90 or 105°C. It seems that adjust_tjmax() would figure it out properly, so we should just call it?

Only reason is that I wasn't sure about those.

Quoted 6 lines

What about 0x1e (Lynnfield)? It was already supported prior to Carsten's changes. I don't know when MSR_IA32_TEMPERATURE_TARGET was introduced, but again I see no reason why adjust_tjmax() wouldn't be good for Lynnfield - at least as good as blindly assuming TjMax at 100°C.

Same here ...

Quoted 5 lines

BTW, I am curious why we read MSR_IA32_TEMPERATURE_TARGET on CPU models, which we know do _not_ have this MSR? This leads to a warning message in the logs. It would seem more logical to call adjust_tjmax() directly if MSR_IA32_TEMPERATURE_TARGET isn't supported.

I think you are right. The warning doesn't really make sense. Maybe I should rearrange the code to just return the value reported by adjust_tjmax() if reading TjMax through MSR_IA32_TEMPERATURE_TARGET fails - what do you think ?

Thanks,
Guenter

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