x86: hwmon/k8temp.c Add support for AMD 10H and 11H
Subsystems (2)
--- drivers/hwmon/k8temp.c | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-)
drivers/hwmon/k8temp.c +23 -2
@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivates * * Copyright (C) 2006 Rudolf Marek <[email protected]> *
@@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04
@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);
@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);
@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }
@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }
@@ -138,6 +153,8 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_10H_NB_MISC ) }, + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };
@@ -157,6 +174,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;
@@ -226,6 +246,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Signature · 1 line
1.6.0.6
Rudolf Marek
maintainerHi,
The reason why there is no support is that the both 10h and 11h and all of them have still the errata which tells that measurements is unreliable. Has it changed?
Thanks,
Rudolf
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Rudolf Marek
Hi,
The reason why there is no support is that the both 10h and 11h and all of them have still the errata which tells that measurements is unreliable. Has it changed?
On my 11h laptop I am getting reading from 56-70 degree C and it seems to correct and reliable to me.
Can you share the problem you faced with 10h and 11h, so that I can check on my side.
Thanks,
--
JSR
Quoted 7 lines · Jaswinder Singh Rajput
Quoted 5 lines · Rudolf Marek
Hi,
The reason why there is no support is that the both 10h and 11h and all of them have still the errata which tells that measurements is unreliable. Has it changed?
Quoted 5 lines
On my 11h laptop I am getting reading from 56-70 degree C and it seems to correct and reliable to me.
Can you share the problem you faced with 10h and 11h, so that I can check on my side.
On further testing I am getting 52 - 88 degree C and I am quite happy with these readings.
Atleast something is better than nothing ;-)
Thanks,
--
JSR
Rudolf Marek
maintainerHi,
Yes it works for most CPUs, but for unlucky users we might get complains from them - and false alarms.
I'm talking about:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
So far all CPUs have the issue.
Rudolf
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 7 lines · Rudolf Marek
Hi,
Yes it works for most CPUs, but for unlucky users we might get complains from them - and false alarms.
I'm talking about:
Quoted 9 lines
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
So far all CPUs have the issue.
From manual :
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
319 Inaccurate Temperature Measurement
Description
The internal thermal sensor used for CurTmp (F3xA4[31:21]), hardware thermal control (HTC), software thermal control (STC) thermal zone, and the sideband temperature sensor interface (SB-TSI) may report inconsistent values.
Potential Effect on System
HTC, STC thermal zone, and SB-TSI do not provide reliable thermal protection. This does not affect THERMTRIP or the use of the STC-active state through StcPstateLimit or StcPstateEn (F3x68[30:28, 5]).
Suggested Workaround
None. Systems should be designed with conventional thermal control and throttling methods or utilize PROCHOT_L functionality based on temperature measurements from an analog thermal diode (THERMDA/THERMDC).
Systems should not rely on the HTC features, STC thermal zone features, or use SB-TSI. Software should not modify HtcTmpLmt (F3x64[22:16]) or enable any of the STC thermal zone features by setting StcApcTmpLoEn, StcApcTmpHiEn, StcSbcTmpLoEn, or StcSpcTmpHiEn (F3x68[3:0]).
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
It seems that this problem is for some K10 processors. And K11 is OK, right ?
I think our patch is safe enough and we will fix the problem for some K10 processors or in the worst case we will remove support for that particular cpu.
Ingo: do you mind to applying this patch on -tip and lets see its feedback and fix the problem.
Thanks
--
JSR
Quoted 7 lines · Rudolf Marek
Hi,
Yes it works for most CPUs, but for unlucky users we might get complains from them - and false alarms.
I'm talking about:
Quoted 8 lines
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
So far all CPUs have the issue.
Rudolf
Here is the patch which will prepare the report for Inaccurate Temperature Measurement to fix/suppress inaccurate Monitoring.
[PATCH] x86: hwmon/k8temp.c Add support for AMD 10H and 11H
Some AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
So Added report message to fix/suppress inaccurate Monitoring.
--- drivers/hwmon/k8temp.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-)
drivers/hwmon/k8temp.c +36 -2
@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivates * * Copyright (C) 2006 Rudolf Marek <[email protected]> *
@@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04
@@ -52,6 +53,20 @@ struct k8temp_data {u32 temp_offset; }; +static const char report[] ="Please send below message to: " +"LKML <[email protected]>, " +"Rudolf Marek <[email protected]>, " +"Jaswinder Singh Rajput <[email protected]>" +"\n\"Invalid temperature:" ; + +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);
@@ -62,6 +77,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);
@@ -89,6 +109,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }
@@ -123,7 +144,14 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset; + +/* Some AMD 10H cpus reports Inaccurate Temperature Measurement */ +if ((temp <21000 ) || (temp >90000 )) +WARN_ONCE (1 ,"%s reg 0x%x temp %d for %d:%d:%d:%d\"\n" , + report, data->temp[core][place], temp, + boot_cpu_data.x86_vendor, boot_cpu_data.x86, + boot_cpu_data.x86_model, boot_cpu_data.x86_mask);return sprintf (buf,"%d\n" , temp); }
@@ -138,6 +166,8 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_10H_NB_MISC ) }, + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };
@@ -157,6 +187,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;
@@ -226,6 +259,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Signature · 1 line
1.6.0.6
Rudolf Marek
maintainerHello,
Sorry I disagree. Lets skip whole 10H. I failed many times to get some useful info from AMD about this issue. I'm strongly against to impose some limits which might indicate what is OK and what is not.
Rudolf
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 6 lines · Rudolf Marek
Hello,
Sorry I disagree. Lets skip whole 10H. I failed many times to get some useful info from AMD about this issue. I'm strongly against to impose some limits which might indicate what is OK and what is not.
OK, So here is new patch after skipping 10H. I hope I will get ack now ;-)
Subject: [PATCH] x86: hwmon/k8temp.c Add support for AMD 11H
This patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
--- drivers/hwmon/k8temp.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)
drivers/hwmon/k8temp.c +29 -2
@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivatives * * Copyright (C) 2006 Rudolf Marek <[email protected]> *
@@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04
@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);
@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);
@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }
@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }
@@ -138,6 +153,14 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, +/* +* AMD 10H cpus reports Inaccurate Temperature Measurement : +* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf +* Errata #319 +* So skipping 10H +{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, +*/ + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };
@@ -157,6 +180,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;
@@ -226,6 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Signature · 1 line
1.6.0.6
Hello Andrew, Greg and Ingo:
Do you think this patch should go to stable and latest git.
Thanks,
--
JSR
Quoted 121 lines · Jaswinder Singh Rajput
Quoted 6 lines · Rudolf Marek
Hello,
Sorry I disagree. Lets skip whole 10H. I failed many times to get some useful info from AMD about this issue. I'm strongly against to impose some limits which might indicate what is OK and what is not.
OK, So here is new patch after skipping 10H. I hope I will get ack now ;-)
Subject: [PATCH] x86:
hwmon/k8temp.cAdd support for AMD 11HThis patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319Signed-off-by Jaswinder Singh Rajput <[email protected]>--- drivers/hwmon/k8temp.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)drivers/hwmon/k8temp.c +29
-2@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivatives * * Copyright (C) 2006 Rudolf Marek <[email protected]> * @@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }@@ -138,6 +153,14 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, +/* +* AMD 10H cpus reports Inaccurate Temperature Measurement : +* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf +* Errata #319 +* So skipping 10H +{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, +*/ + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };@@ -157,6 +180,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;@@ -226,6 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Quoted 3 lines · Jaswinder Singh Rajput
Hello Andrew, Greg and Ingo:
Do you think this patch should go to stable and latest git.
Definitely not to stable, it's not fixing any bug.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 7 lines · Jean Delvare
Quoted 3 lines · Jaswinder Singh Rajput
Hello Andrew, Greg and Ingo:
Do you think this patch should go to stable and latest git.
Definitely not to stable, it's not fixing any bug.
Ok, so you suggested this should go to latest git.
I proposed for stable because I was using AMD 11H from last 6 months and I was missing temperature monitor badly because my earlier Laptop was broken by overheating. So I thought if it goes to stable then users will start getting benefit of it, but if you want that users should wait for another 2 years. Then it is OK ;-)
Thanks,
--
JSR
Quoted 9 lines · Jaswinder Singh Rajput
Quoted 7 lines · Jean Delvare
Quoted 3 lines · Jaswinder Singh Rajput
Hello Andrew, Greg and Ingo:
Do you think this patch should go to stable and latest git.
Definitely not to stable, it's not fixing any bug.
Quoted 7 lines
Ok, so you suggested this should go to latest git.
I proposed for stable because I was using AMD 11H from last 6 months and I was missing temperature monitor badly because my earlier Laptop was broken by overheating. So I thought if it goes to stable then users will start getting benefit of it, but if you want that users should wait for another 2 years. Then it is OK ;-)
2 years? The next kernel release will be out in 3 months, we have a very predictable release schedule.
thanks,
greg k-h
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Greg,
Quoted 12 lines · Greg KH
Quoted 11 lines · Jaswinder Singh Rajput
Quoted 7 lines · Jean Delvare
Quoted 3 lines · Jaswinder Singh Rajput
Hello Andrew, Greg and Ingo:
Do you think this patch should go to stable and latest git.
Definitely not to stable, it's not fixing any bug.
Ok, so you suggested this should go to latest git.
Quoted 9 lines
Quoted 5 lines
I proposed for stable because I was using AMD 11H from last 6 months and I was missing temperature monitor badly because my earlier Laptop was broken by overheating. So I thought if it goes to stable then users will start getting benefit of it, but if you want that users should wait for another 2 years. Then it is OK ;-)
2 years? The next kernel release will be out in 3 months, we have a very predictable release schedule.
I am sorry for being unclear. I meant for linux distros. Even one of the most active Fedora 10 is using vmlinuz-2.6.27.24-170.2.68.fc10.x86_64 is almost 7 months behind the linus git. And another linux distro are still using 2.6.22 or so which are almost 2 years behind linus git.
Thanks,
--
JSR
Quoted 10 lines · Jaswinder Singh Rajput
Hi Greg,
Quoted 7 lines · Greg KH
Quoted 5 lines · Jaswinder Singh Rajput
I proposed for stable because I was using AMD 11H from last 6 months and I was missing temperature monitor badly because my earlier Laptop was broken by overheating. So I thought if it goes to stable then users will start getting benefit of it, but if you want that users should wait for another 2 years. Then it is OK ;-)
Quoted 7 lines
Quoted 2 lines
2 years? The next kernel release will be out in 3 months, we have a very predictable release schedule.
I am sorry for being unclear. I meant for linux distros. Even one of the most active Fedora 10 is using vmlinuz-2.6.27.24-170.2.68.fc10.x86_64 is almost 7 months behind the linus git. And another linux distro are still using 2.6.22 or so which are almost 2 years behind linus git.
Distributions are free to backport any patch they like to their kernel tree, at any time.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hello Rudolf,
Quoted 13 lines · Jaswinder Singh Rajput
Quoted 6 lines · Rudolf Marek
Hello,
Sorry I disagree. Lets skip whole 10H. I failed many times to get some useful info from AMD about this issue. I'm strongly against to impose some limits which might indicate what is OK and what is not.
OK, So here is new patch after skipping 10H. I hope I will get ack now ;-)
Subject: [PATCH] x86:
hwmon/k8temp.cAdd support for AMD 11H
Quoted 8 lines
This patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319Signed-off-by Jaswinder Singh Rajput <[email protected]>---
As per your suggestion I skipped whole 10H. Have you queued this patch or there is still some issues left.
Thanks,
--
JSR
[HWMON] x86: hwmon/k8temp.c Add support for AMD 11H
In reply to Jaswinder Singh RajputThis patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319
--- drivers/hwmon/k8temp.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)
drivers/hwmon/k8temp.c +29 -2
@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivatives * * Copyright (C) 2006 Rudolf Marek <[email protected]> *
@@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04
@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);
@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);
@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }
@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }
@@ -138,6 +153,14 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, +/* +* AMD 10H cpus reports Inaccurate Temperature Measurement : +* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf +* Errata #319 +* So skipping 10H +{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, +*/ + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };
@@ -157,6 +180,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;
@@ -226,6 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Signature · 1 line
1.6.0.6
Re: [HWMON] x86: hwmon/k8temp.c Add support for AMD 11H
Ingo,
I need to apply and then revert this patch each and every time I fetch -tip tree. And I need to do this many times like 20-30 times in a day.
I need this patch to monitor the temperature for AMD 11H box as it is very hot here temp is around 47 C and my CPU temp goes high upto 87 C. My one AMD box is already broken due to high temperature.
By using this patch I breaks building of the kernel as temperature reaches 80 C.
I hope you understand my problem.
If possible, can you please apply this patch in tip:out-of-tree (not-for-upstream)
Thanks,
--
JSR
Quoted 108 lines · Jaswinder Singh Rajput
This patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319Signed-off-by Jaswinder Singh Rajput <[email protected]>--- drivers/hwmon/k8temp.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)drivers/hwmon/k8temp.c +29
-2@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivatives * * Copyright (C) 2006 Rudolf Marek <[email protected]> * @@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }@@ -138,6 +153,14 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, +/* +* AMD 10H cpus reports Inaccurate Temperature Measurement : +* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf +* Errata #319 +* So skipping 10H +{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, +*/ + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };@@ -157,6 +180,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;@@ -226,6 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Re: [HWMON] x86: hwmon/k8temp.c Add support for AMD 11H
Hello Ingo,
Now I do not use -tip tree, if you want you can remove this patch from -tip (commit 318e6a08d340d85)
Thanks for your help and support.
--
JSR
Quoted 130 lines · Jaswinder Singh Rajput
Ingo,
I need to apply and then revert this patch each and every time I fetch -tip tree. And I need to do this many times like 20-30 times in a day.
I need this patch to monitor the temperature for AMD 11H box as it is very hot here temp is around 47 C and my CPU temp goes high upto 87 C. My one AMD box is already broken due to high temperature.
By using this patch I breaks building of the kernel as temperature reaches 80 C.
I hope you understand my problem.
If possible, can you please apply this patch in tip:out-of-tree (not-for-upstream)
Thanks,
--
JSRQuoted 108 lines · Jaswinder Singh Rajput
This patch will also work for AMD 10H. But we are skipping it as :
AMD 10H cpus reports Inaccurate Temperature Measurement:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf
Errata #319Signed-off-by Jaswinder Singh Rajput <[email protected]>--- drivers/hwmon/k8temp.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)drivers/hwmon/k8temp.c +29
-2@@ -1,5 +1,6 @@/* * k8temp.c - Linux kernel module for hardware monitoring +* for AMD K8 and derivatives * * Copyright (C) 2006 Rudolf Marek <[email protected]> * @@ -33,7 +34,7 @@#include <linux/mutex.h> #include <asm/processor.h> -#define TEMP_FROM_REG (val) (((((val) >> 16) & 0xff) - 49) * 1000) +#define REG_TCTL 0xa4#define REG_TEMP 0xe4#define SEL_PLACE 0x40#define SEL_CORE 0x04@@ -52,6 +53,14 @@ struct k8temp_data {u32 temp_offset; }; +static unsigned long temp_from_reg (unsigned long val) +{ +if (boot_cpu_data.x86 >0xf ) +return ((val) >>21 ) *125 ; +else +return ((((val) >>16 ) &0xff ) -49 ) *1000 ; +} +static struct k8temp_data *k8temp_update_device (struct device *dev) {struct k8temp_data *data =dev_get_drvdata (dev);@@ -62,6 +71,11 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)if (!data->valid ||time_after (jiffies, data->last_updated +HZ )) { +if (boot_cpu_data.x86 >0xf ) { +pci_read_config_dword (pdev,REG_TCTL , + &data->temp[0 ][0 ]); + goto update_done; + }pci_read_config_byte (pdev,REG_TEMP , &tmp); tmp &= ~(SEL_PLACE |SEL_CORE );/* Select sensor 0, core0 */ pci_write_config_byte (pdev,REG_TEMP , tmp);@@ -89,6 +103,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev) } } +update_done: data->last_updated = jiffies; data->valid =1 ; }@@ -123,7 +138,7 @@ static ssize_t show_temp(struct device *dev,if (data->swap_core_select) core = core ?0 :1 ; - temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset; + temp =temp_from_reg (data->temp[core][place]) + data->temp_offset;return sprintf (buf,"%d\n" , temp); }@@ -138,6 +153,14 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);static struct pci_device_id k8temp_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_K8_NB_MISC ) }, +/* +* AMD 10H cpus reports Inaccurate Temperature Measurement : +* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf +* Errata #319 +* So skipping 10H +{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, +*/ + {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_11H_NB_MISC ) }, {0 }, };@@ -157,6 +180,9 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, goto exit; } +if (boot_cpu_data.x86 >0xf ) + goto probe_done; + model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask;@@ -226,6 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, data->sensorsp &= ~SEL_CORE ; } +probe_done: data->name ="k8temp" ;mutex_init (&data->update_lock);dev_set_drvdata (&pdev->dev, data);
Hi Jaswinder,
Quoted 1 line · Jaswinder Singh Rajput
Atleast something is better than nothing ;-)
Sorry but you are wrong here. When it comes to hardware monitoring (or monitoring in general), potentially wrong data is _worse_ than no data at all, unless you additionally carry the information that the data value may be wrong, and display it in a very visible manner. As our sysfs interface doesn't provide any way to pass reliability information to the reader (and I don't think it would make sense to add one), it is better to not export data that we know can't be trusted.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hello Jean,
Quoted 5 lines · Jean Delvare
Hi Jaswinder,
Quoted 1 line · Jaswinder Singh Rajput
Atleast something is better than nothing ;-)
Quoted 8 lines
Sorry but you are wrong here. When it comes to hardware monitoring (or monitoring in general), potentially wrong data is _worse_ than no data at all, unless you additionally carry the information that the data value may be wrong, and display it in a very visible manner. As our sysfs interface doesn't provide any way to pass reliability information to the reader (and I don't think it would make sense to add one), it is better to not export data that we know can't be trusted.
As I said in my previous email that it seems problem is with few 10H cpus and 11H are OK.
So better we will fix wrong information or suppress information for those specific cpus.
On my 11H laptop monitoring seems very reliable. So in the worst case we drop support for 10H.
Thanks,
--
JSR