]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.17/hwmon-coretemp-properly-label-the-sensors.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / hwmon-coretemp-properly-label-the-sensors.patch
1 From 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <khali@linux-fr.org>
3 Date: Fri, 9 Jul 2010 16:22:51 +0200
4 Subject: hwmon: (coretemp) Properly label the sensors
5
6 From: Jean Delvare <khali@linux-fr.org>
7
8 commit 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c upstream.
9
10 Don't assume that CPU entry number and core ID always match. It
11 worked in the simple cases (single CPU, no HT) but fails on
12 multi-CPU systems.
13
14 Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 Acked-by: Huaxu Wan <huaxu.wan@intel.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18 ---
19 drivers/hwmon/coretemp.c | 6 +++++-
20 1 file changed, 5 insertions(+), 1 deletion(-)
21
22 --- a/drivers/hwmon/coretemp.c
23 +++ b/drivers/hwmon/coretemp.c
24 @@ -53,6 +53,7 @@ struct coretemp_data {
25 struct mutex update_lock;
26 const char *name;
27 u32 id;
28 + u16 core_id;
29 char valid; /* zero until following fields are valid */
30 unsigned long last_updated; /* in jiffies */
31 int temp;
32 @@ -75,7 +76,7 @@ static ssize_t show_name(struct device *
33 if (attr->index == SHOW_NAME)
34 ret = sprintf(buf, "%s\n", data->name);
35 else /* show label */
36 - ret = sprintf(buf, "Core %d\n", data->id);
37 + ret = sprintf(buf, "Core %d\n", data->core_id);
38 return ret;
39 }
40
41 @@ -255,6 +256,9 @@ static int __devinit coretemp_probe(stru
42 }
43
44 data->id = pdev->id;
45 +#ifdef CONFIG_SMP
46 + data->core_id = c->cpu_core_id;
47 +#endif
48 data->name = "coretemp";
49 mutex_init(&data->update_lock);
50