hwmon: (coretemp) Fix for non-SMP builds
Subsystems (2)
PATCH 1/1 hwmon: (coretemp) Fix for non-SMP builds
The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases.
Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
--- drivers/hwmon/coretemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/coretemp.c +1 -2
@@ -50,14 +50,13 @@#ifdef CONFIG_SMP #define TO_PHYS_ID (cpu) cpu_data(cpu).phys_proc_id#define TO_CORE_ID (cpu) cpu_data(cpu).cpu_core_id -#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)#define for_each_sibling (i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))#else #define TO_PHYS_ID (cpu) (cpu)#define TO_CORE_ID (cpu) (cpu) -#define TO_ATTR_NO (cpu) (cpu)#define for_each_sibling (i, cpu) for (i = 0; false; )#endif +#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)/* * Per-Core Temperature Data
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Nice Catch.
Thanks Jean for the fix.
Quoted 11 lines
-----Original Message-----
From: Jean Delvare [mailto:[email protected]]
Sent: Saturday, November 05, 2011 11:24 PM
To: LM Sensors
Cc: R, Durgadoss; Guenter Roeck; Phil Sutter
Subject: [PATCH] hwmon: (coretemp) Fix for non-SMP buildsThe definition of
TO_ATTR_NOin the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases.
Quoted 5 lines
Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
Signed-off-by Jean Delvare <[email protected]>Tested-by Phil Sutter <[email protected]>
Thanks,
Durga
Quoted 25 lines
--- drivers/hwmon/coretemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)---
linux-3.0.orig/drivers/hwmon/coretemp.c2011-11-05 18:39:36.000000000
+0100
+++linux-3.0/drivers/hwmon/coretemp.c2011-11-05 18:48:19.000000000 +0100drivers/hwmon/coretemp.c +1
-3@@ -50,14 +50,13 @@#ifdef CONFIG_SMP #define TO_PHYS_ID (cpu) cpu_data(cpu).phys_proc_id#define TO_CORE_ID (cpu) cpu_data(cpu).cpu_core_id -#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)#define for_each_sibling (i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))#else #define TO_PHYS_ID (cpu) (cpu)#define TO_CORE_ID (cpu) (cpu) -#define TO_ATTR_NO (cpu) (cpu)#define for_each_sibling (i, cpu) for (i = 0; false; )#endif +#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)/* * Per-Core Temperature Data --
Quoted 1 line
Jean Delvare
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Jean Delvare
The definition of
TO_ATTR_NOin the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases.Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
Signed-off-by Jean Delvare <[email protected]>Tested-by Phil Sutter <[email protected]>
Jean, I assume you take that one ?
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare
The definition of
TO_ATTR_NOin the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases.
Quoted 7 lines
Quoted 5 lines
Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
Signed-off-by Jean Delvare <[email protected]>Tested-by Phil Sutter <[email protected]>Acked-by Guenter Roeck <[email protected]>
Thanks.
Quoted 1 line
Jean, I assume you take that one ?
Yes I will.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors