hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
Subsystems (2)
Guenter Roeck
maintainerRFC PATCH 1/1 hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
Atom CPUs don't have a register to retrieve TjMax. Detection so far is incomplete. Use the X86 model ID to improve it.
---
Wonder if we can improve TjMax detection for Atom CPUs with this code. Anyone with Atom CPUs out there for some testing ?
drivers/hwmon/coretemp.c | 44 ++++++++++++++++++++++++++++++++------------ 1 files changed, 32 insertions(+), 12 deletions(-)
drivers/hwmon/coretemp.c +32 -12
@@ -191,6 +191,29 @@ static ssize_t show_temp(struct device *dev,return tdata->valid ?sprintf (buf,"%d\n" , tdata->temp) : -EAGAIN ; } +struct tjmax { +char const *id; +int tjmax; +}; + +static struct tjmax atom_tjmax[] = { + {"CPU D410" ,100000 }, + {"CPU D425" ,100000 }, + {"CPU D510" ,100000 }, + {"CPU D525" ,100000 }, + {"CPU N450" ,100000 }, + {"CPU N455" ,100000 }, + {"CPU N470" ,100000 }, + {"CPU N475" ,100000 }, + {"CPU 230" ,100000 }, + {"CPU 330" ,125000 }, + {"CPU E620T" ,110000 }, + {"CPU E640T" ,110000 }, + {"CPU E660T" ,110000 }, + {"CPU E680T" ,110000 }, + { }, +}; +static int __cpuinit adjust_tjmax (struct cpuinfo_x86 *c,u32 id,struct device *dev) {
@@ -201,7 +224,6 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,int usemsr_ee =1 ;int err;u32 eax, edx; -struct pci_dev *host_bridge;/* Early chips have no MSR for TjMax */
@@ -211,18 +233,16 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,/* Atom CPUs */ if (c->x86_model =0x1c ) { - usemsr_ee =0 ; +struct tjmax *tj; - host_bridge =pci_get_bus_and_slot (0 ,PCI_DEVFN (0 ,0 )); - -if (host_bridge && host_bridge->vendor =PCI_VENDOR_ID_INTEL - && (host_bridge->device =0xa000 /* NM10 based nettop */ - || host_bridge->device =0xa010 ))/* NM10 based netbook */ - tjmax =100000 ; -else - tjmax =90000 ; - -pci_dev_put (host_bridge); + usemsr_ee =0 ; + tjmax =90000 ; +for (tj = atom_tjmax; tj->tjmax; tj++) { +if (strstr (c->x86_model_id, tj->id)) { + tjmax = tj->tjmax; +break ; + } + } }if (c->x86_model >0xe && usemsr_ee) {
Signature · 7 lines
1.7.5.4 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:lm-sensors-bounces@lm- sensors.org] On Behalf Of Guenter Roeck
Sent: Monday, June 04, 2012 10:08 PM
To: lm-sensors
Cc: Guenter Roeck
Subject: [lm-sensors] [PATCH RFC] hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
Quoted 3 lines
Atom CPUs don't have a register to retrieve TjMax. Detection so far is incomplete. Use the X86 model ID to improve it.
Thanks for the patch...
Quoted 4 lines
Signed-off-by Guenter Roeck <[email protected]>---
Wonder if we can improve TjMax detection for Atom CPUs with this code. Anyone with Atom CPUs out there for some testing ?
I can test it out on the Medfield platform (Atom based). But its Tjmax is 90 C. I don't see any 90 C values in your array. is there a reason behind it ?
Or we can add as we find more models ?
Thanks,
Durga
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
[email protected]
maintainerQuoting "R, Durgadoss" <[email protected]>:
Quoted 15 lines
Hi Guenter,
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:lm-sensors-bounces@lm- sensors.org] On Behalf Of Guenter Roeck
Sent: Monday, June 04, 2012 10:08 PM
To: lm-sensors
Cc: Guenter Roeck
Subject: [lm-sensors] [PATCH RFC] hwmon: (coretemp) Improve support for TjMax detection on Atom CPUsQuoted 3 lines
Atom CPUs don't have a register to retrieve TjMax. Detection so far is incomplete. Use the X86 model ID to improve it.
Quoted 8 lines
Thanks for the patch...
Quoted 4 lines
Signed-off-by Guenter Roeck <[email protected]>---
Wonder if we can improve TjMax detection for Atom CPUs with this code. Anyone with Atom CPUs out there for some testing ?I can test it out on the Medfield platform (Atom based).
You will need Jean's pending patch for that, to detect the new Atom CPU model.
Quoted 2 lines
But its Tjmax is 90 C. I don't see any 90 C values in your array. is there a reason behind it ?
Hi Durga,
If you look closely at the patch, you will notice that the Atom code starts with
tjmax = 90000;
90 degrees C is thus the default case. The table only includes values for CPUs with a different tjmax. That keeps the table a bit smaller.
Quoted 2 lines
Or we can add as we find more models ?
Definitely ...
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
[big cut.]
Quoted 9 lines
If you look closely at the patch, you will notice that the Atom code starts with
tjmax = 90000;90 degrees C is thus the default case. The table only includes values for CPUs with a different tjmax. That keeps the table a bit smaller.
Oh got it...and it makes sense. I will try in a couple of days and reply here.
Thanks,
Durga
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 7 lines · Guenter Roeck
Atom CPUs don't have a register to retrieve TjMax. Detection so far is incomplete. Use the X86 model ID to improve it.
Signed-off-by Guenter Roeck <[email protected]>---
Wonder if we can improve TjMax detection for Atom CPUs with this code. Anyone with Atom CPUs out there for some testing ?
Not here, sorry.
Quoted 17 lines
drivers/hwmon/coretemp.c | 44 ++++++++++++++++++++++++++++++++------------ 1 files changed, 32 insertions(+), 12 deletions(-)drivers/hwmon/coretemp.c +6
-0@@ -191,6 +191,29 @@ static ssize_t show_temp(struct device *dev,return tdata->valid ?sprintf (buf,"%d\n" , tdata->temp) : -EAGAIN ; } +struct tjmax { +char const *id; +int tjmax; +}; + +static struct tjmax atom_tjmax[] = {
drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 209
Quoted 10 lines
drivers/hwmon/coretemp.c +10
-0+ { "CPU D410", 100000 }, + { "CPU D425", 100000 }, + { "CPU D510", 100000 }, + { "CPU D525", 100000 }, + { "CPU N450", 100000 }, + { "CPU N455", 100000 }, + { "CPU N470", 100000 }, + { "CPU N475", 100000 }, + { "CPU 230", 100000 }, + { "CPU 330", 125000 },
I suspect this won't work, there seems to be a double space between "CPU" and the number. See:
http://lists.lm-sensors.org/pipermail/lm-sensors/2010-May/028544.html
http://lists.lm-sensors.org/pipermail/lm-sensors/2012-June/036236.html
Oh, this is fixed in v2, ignore.
drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 213
Quoted 4 lines
drivers/hwmon/coretemp.c +4
-0+ { "CPU E620T", 110000 }, + { "CPU E640T", 110000 }, + { "CPU E660T", 110000 }, + { "CPU E680T", 110000 },
This probably won't work either, as for an unknown reason Intel did not encode the model number for at least some of these Atom CPUs:
http://lists.lm-sensors.org/pipermail/lm-sensors/2011-June/033010.html
This is even the reason why we did not use the processor name strings back then.
Quoted 21 lines
drivers/hwmon/coretemp.c +4
-2+ { }, +}; +static int __cpuinit adjust_tjmax (struct cpuinfo_x86 *c,u32 id,struct device *dev) {@@ -201,7 +224,6 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,int usemsr_ee =1 ;int err;u32 eax, edx; -struct pci_dev *host_bridge;/* Early chips have no MSR for TjMax */ @@ -211,18 +233,16 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,/* Atom CPUs */ if (c->x86_model =0x1c ) { - usemsr_ee =0 ; +struct tjmax *tj;
drivers/hwmon/coretemp.c static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, · line 225
Quoted 10 lines
drivers/hwmon/coretemp.c +0
-10- host_bridge =pci_get_bus_and_slot (0 ,PCI_DEVFN (0 ,0 )); - -if (host_bridge && host_bridge->vendor =PCI_VENDOR_ID_INTEL - && (host_bridge->device =0xa000 /* NM10 based nettop */ - || host_bridge->device =0xa010 ))/* NM10 based netbook */ - tjmax =100000 ; -else - tjmax =90000 ; - -pci_dev_put (host_bridge);
You are dropping a known-to-work heuristic for one which hasn't been tested on these models. Don't get me wrong, I'd be very happy to get rid of this code, I just don't want us to introduce a regression.
drivers/hwmon/coretemp.c static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, · line 240
Quoted 3 lines
drivers/hwmon/coretemp.c +3
-0+ usemsr_ee =0 ; + tjmax =90000 ; +for (tj = atom_tjmax; tj->tjmax; tj++) {
Any reason for not using a regular array and ARRAY_SIZE?
Quoted 8 lines
drivers/hwmon/coretemp.c +5
-0+if (strstr (c->x86_model_id, tj->id)) { + tjmax = tj->tjmax; +break ; + } + } }if (c->x86_model >0xe && usemsr_ee) {
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 48 lines · Jean Delvare
Hi Guenter,
Quoted 7 lines · Guenter Roeck
Atom CPUs don't have a register to retrieve TjMax. Detection so far is incomplete. Use the X86 model ID to improve it.
Signed-off-by Guenter Roeck <[email protected]>---
Wonder if we can improve TjMax detection for Atom CPUs with this code. Anyone with Atom CPUs out there for some testing ?Not here, sorry.
Quoted 17 lines
drivers/hwmon/coretemp.c | 44 ++++++++++++++++++++++++++++++++------------ 1 files changed, 32 insertions(+), 12 deletions(-)drivers/hwmon/coretemp.c +6
-0@@ -191,6 +191,29 @@ static ssize_t show_temp(struct device *dev,return tdata->valid ?sprintf (buf,"%d\n" , tdata->temp) : -EAGAIN ; } +struct tjmax { +char const *id; +int tjmax; +}; + +static struct tjmax atom_tjmax[] = {drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 209
Quoted 10 lines
drivers/hwmon/coretemp.c +10
-0+ { "CPU D410", 100000 }, + { "CPU D425", 100000 }, + { "CPU D510", 100000 }, + { "CPU D525", 100000 }, + { "CPU N450", 100000 }, + { "CPU N455", 100000 }, + { "CPU N470", 100000 }, + { "CPU N475", 100000 }, + { "CPU 230", 100000 }, + { "CPU 330", 125000 },I suspect this won't work, there seems to be a double space between "CPU" and the number. See:
http://lists.lm-sensors.org/pipermail/lm-sensors/2010-May/028544.html
http://lists.lm-sensors.org/pipermail/lm-sensors/2012-June/036236.htmlOh, this is fixed in v2, ignore.
Quoted 11 lines
drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 213
Quoted 4 lines
drivers/hwmon/coretemp.c +4
-0+ { "CPU E620T", 110000 }, + { "CPU E640T", 110000 }, + { "CPU E660T", 110000 }, + { "CPU E680T", 110000 },This probably won't work either, as for an unknown reason Intel did not encode the model number for at least some of these Atom CPUs:
http://lists.lm-sensors.org/pipermail/lm-sensors/2011-June/033010.html
This is even the reason why we did not use the processor name strings back then.
Ah, now I remember. That explains why I didn't find any online logs with those IDs. Would be great to find PCI bridge ID we could use instead ...
Quoted 21 lines
Quoted 21 lines
drivers/hwmon/coretemp.c +4
-2+ { }, +}; +static int __cpuinit adjust_tjmax (struct cpuinfo_x86 *c,u32 id,struct device *dev) {@@ -201,7 +224,6 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,int usemsr_ee =1 ;int err;u32 eax, edx; -struct pci_dev *host_bridge;/* Early chips have no MSR for TjMax */ @@ -211,18 +233,16 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,/* Atom CPUs */ if (c->x86_model =0x1c ) { - usemsr_ee =0 ; +struct tjmax *tj;
Quoted 15 lines
drivers/hwmon/coretemp.c static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, · line 225
Quoted 10 lines
drivers/hwmon/coretemp.c +0
-10- host_bridge =pci_get_bus_and_slot (0 ,PCI_DEVFN (0 ,0 )); - -if (host_bridge && host_bridge->vendor =PCI_VENDOR_ID_INTEL - && (host_bridge->device =0xa000 /* NM10 based nettop */ - || host_bridge->device =0xa010 ))/* NM10 based netbook */ - tjmax =100000 ; -else - tjmax =90000 ; - -pci_dev_put (host_bridge);You are dropping a known-to-work heuristic for one which hasn't been tested on these models. Don't get me wrong, I'd be very happy to get rid of this code, I just don't want us to introduce a regression.
Good point. I'll keep it.
Quoted 6 lines
drivers/hwmon/coretemp.c static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, · line 240
Quoted 3 lines
drivers/hwmon/coretemp.c +3
-0+ usemsr_ee =0 ; + tjmax =90000 ; +for (tj = atom_tjmax; tj->tjmax; tj++) {Any reason for not using a regular array and
ARRAY_SIZE?
No.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 13 lines · Guenter Roeck
Quoted 12 lines · Jean Delvare
drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 213
Quoted 4 lines · Guenter Roeck
drivers/hwmon/coretemp.c +4
-0+ { "CPU E620T", 110000 }, + { "CPU E640T", 110000 }, + { "CPU E660T", 110000 }, + { "CPU E680T", 110000 },This probably won't work either, as for an unknown reason Intel did not encode the model number for at least some of these Atom CPUs:
http://lists.lm-sensors.org/pipermail/lm-sensors/2011-June/033010.html
This is even the reason why we did not use the processor name strings back then.
Quoted 2 lines
Ah, now I remember. That explains why I didn't find any online logs with those IDs. Would be great to find PCI bridge ID we could use instead ...
You can read the whole thread, to see if this was already discussed. I seem to recall we did and concluded it wasn't an option, but I could remember wrongly.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 14 lines · Jean Delvare
Quoted 13 lines · Guenter Roeck
Quoted 12 lines · Jean Delvare
drivers/hwmon/coretemp.c static ssize_t show_temp(struct device *dev, · line 213
Quoted 4 lines · Guenter Roeck
drivers/hwmon/coretemp.c +4
-0+ { "CPU E620T", 110000 }, + { "CPU E640T", 110000 }, + { "CPU E660T", 110000 }, + { "CPU E680T", 110000 },This probably won't work either, as for an unknown reason Intel did not encode the model number for at least some of these Atom CPUs:
http://lists.lm-sensors.org/pipermail/lm-sensors/2011-June/033010.html
This is even the reason why we did not use the processor name strings back then.
Quoted 7 lines
Quoted 2 lines
Ah, now I remember. That explains why I didn't find any online logs with those IDs. Would be great to find PCI bridge ID we could use instead ...
You can read the whole thread, to see if this was already discussed. I seem to recall we did and concluded it wasn't an option, but I could remember wrongly.
It doesn't cover all CPUs, but it should cover all Atoms except for the E6xx series. I did find model name info for all other Atom CPUs on the web - this is how I noticed the N2000 and D2000 series. The N2000 and D2000 series all have a TjMax of 100 degrees C, so we don't need a table for those. I changed the code to handle model ID 0x36 separately and set TjMax for those directly to 100 degrees C.
Do you have access to the Medfield Atom (Z2640) specification ? I did not find anything on the Intel web site. It would be interesting to know its TjMax. Same for the CE4100 - Intel seems to closely guard those specifications.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 4 lines · Guenter Roeck
Do you have access to the Medfield Atom (Z2640) specification ? I did not find anything on the Intel web site. It would be interesting to know its TjMax. Same for the CE4100 - Intel seems to closely guard those specifications.
I don't. Durga or Fenghua maybe?
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter/Jean,
Quoted 8 lines · Guenter Roeck
Quoted 4 lines
Do you have access to the Medfield Atom (Z2640) specification ? I did not find anything on the Intel web site. It would be interesting to know its TjMax. Same for the CE4100 - Intel seems to closely guard those specifications.
I don't. Durga or Fenghua maybe?
I don't have any public specification as such. I use the same platform for testing. There it says TjMax is 90 (which corresponds to cpu model 0x27).
This is the patch that Jean has submitted a couple of days ago.
Guenter, Could you please give me website link where you are getting details on TjMax for other platforms ? I will try and see if I can make people add the 'Atom platform' details also there.
BTW, my Medfield platform's /proc/cpuinfo says model as Z2460 whereas you are saying Z2640. Is it a typo or actually reported as Z2640 somewhere ?
Thanks,
Durga
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Durgadoss
Hi Guenter/Jean,
Quoted 7 lines · Guenter Roeck
Quoted 4 lines
Do you have access to the Medfield Atom (Z2640) specification ? I did not find anything on the Intel web site. It would be interesting to know its TjMax. Same for the CE4100 - Intel seems to closely guard those specifications.
Quoted 6 lines
Quoted 1 line
I don't. Durga or Fenghua maybe?
I don't have any public specification as such. I use the same platform for testing. There it says TjMax is 90 (which corresponds to cpu model
0x27).
This is the patch that Jean has submitted a couple of days ago.
Hi Durga,
sorry, you lost me. What do you mean with "there" ? If it is what coretemp reports, it is just a wild guess, unless you or Jean know better from some document.
Quoted 4 lines
Guenter, Could you please give me website link where you are getting details on TjMax for other platforms ? I will try and see if I can make people add the 'Atom platform' details also there.
Usually it is in the device datasheet / specification or the device thermal guide if it exists. I don't think there is a single web site with all the information, or at least I don't know one. Problem is that no such documentation seems to exist, at least not in public, for the Z2460 (or CE4100, for that matter). Only reason for mentioning CE4100 is that someone suggested a patch for it a couple of years ago, but it went nowhere, presumably since tjmax (supposedly 110 C) was never confirmed, nor are there well defined means to detect it.
Quoted 3 lines
BTW, my Medfield platform's
/proc/cpuinfosays model as Z2460 whereas you are saying Z2640. Is it a typo or actually reported as Z2640 somewhere ?
Typo, sorry.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
[snip.]
Quoted 9 lines
Quoted 4 lines
I don't have any public specification as such. I use the same platform for testing. There it says TjMax is 90 (which corresponds to cpu model
0x27).
This is the patch that Jean has submitted a couple of days ago.Hi Durga,
sorry, you lost me. What do you mean with "there" ? If it is what coretemp reports,
it is just a wild guess, unless you or Jean know better from some document.
It is what coretemp reports.
I know it is 90C, from an internal document, though :-( That's why was asking is there a place where I can ask folks to update.
Quoted 7 lines
Quoted 2 lines
Guenter, Could you please give me website link where you are getting details
on
Quoted 3 lines
TjMax for other platforms ? I will try and see if I can make people add the 'Atom platform' details also there.
Quoted 11 lines
Usually it is in the device datasheet / specification or the device thermal guide if it exists. I don't think there is a single web site with all the information, or at least I don't know one. Problem is that no such documentation seems to exist,
at least not in public, for the Z2460 (or CE4100, for that matter). Only reason for mentioning CE4100 is that someone suggested a patch for it a couple of years ago,
but it went nowhere, presumably since tjmax (supposedly 110 C) was never confirmed,
nor are there well defined means to detect it.
I will see if I can talk to people to see what can be done better here. I will try & try & try.. :-)
Thanks,
Durga
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Durgadoss
Hi Guenter,
[snip.]
Quoted 6 lines
Quoted 4 lines
I don't have any public specification as such. I use the same platform for testing. There it says TjMax is 90 (which corresponds to cpu model
0x27).
This is the patch that Jean has submitted a couple of days ago.Hi Durga,
Quoted 8 lines
Quoted 3 lines
sorry, you lost me. What do you mean with "there" ? If it is what coretemp reports,
it is just a wild guess, unless you or Jean know better from some document.It is what coretemp reports.
I know it is 90C, from an internal document, though :-( That's why was asking is there a place where I can ask folks to update.
That is easy - we can add it to Documentation/hwmon/coretemp. I'll do that with my series of patches.
Quoted 19 lines
Quoted 7 lines
Quoted 2 lines
Guenter, Could you please give me website link where you are getting details
on
Quoted 3 lines
TjMax for other platforms ? I will try and see if I can make people add the 'Atom platform' details also there.
Quoted 11 lines
Usually it is in the device datasheet / specification or the device thermal guide if it exists. I don't think there is a single web site with all the information, or at least I don't know one. Problem is that no such documentation seems to exist,
at least not in public, for the Z2460 (or CE4100, for that matter). Only reason for mentioning CE4100 is that someone suggested a patch for it a couple of years ago,
but it went nowhere, presumably since tjmax (supposedly 110 C) was never confirmed,
nor are there well defined means to detect it.
Quoted 3 lines
I will see if I can talk to people to see what can be done better here. I will try & try & try.. :-)
Thanks!
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors