* [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds
@ 2011-11-05 17:54 Jean Delvare
2011-11-05 18:16 ` R, Durgadoss
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jean Delvare @ 2011-11-05 17:54 UTC (permalink / raw)
To: lm-sensors
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.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Phil Sutter <phil@nwl.cc>
---
drivers/hwmon/coretemp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- linux-3.0.orig/drivers/hwmon/coretemp.c 2011-11-05 18:39:36.000000000 +0100
+++ linux-3.0/drivers/hwmon/coretemp.c 2011-11-05 18:48:19.000000000 +0100
@@ -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
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds
2011-11-05 17:54 [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds Jean Delvare
@ 2011-11-05 18:16 ` R, Durgadoss
2011-11-05 21:58 ` Guenter Roeck
2011-11-06 9:30 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: R, Durgadoss @ 2011-11-05 18:16 UTC (permalink / raw)
To: lm-sensors
Nice Catch.
Thanks Jean for the fix.
> -----Original Message-----
> From: Jean Delvare [mailto:khali@linux-fr.org]
> 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 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.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Tested-by: Phil Sutter <phil@nwl.cc>
Acked-By: Durgadoss R <Durgadoss.r@intel.com>
Thanks,
Durga
> ---
> drivers/hwmon/coretemp.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- linux-3.0.orig/drivers/hwmon/coretemp.c 2011-11-05 18:39:36.000000000
> +0100
> +++ linux-3.0/drivers/hwmon/coretemp.c 2011-11-05 18:48:19.000000000 +0100
> @@ -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
>
> --
> Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds
2011-11-05 17:54 [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds Jean Delvare
2011-11-05 18:16 ` R, Durgadoss
@ 2011-11-05 21:58 ` Guenter Roeck
2011-11-06 9:30 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2011-11-05 21:58 UTC (permalink / raw)
To: lm-sensors
On Sat, Nov 05, 2011 at 01:54:11PM -0400, Jean Delvare wrote:
> 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.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Tested-by: Phil Sutter <phil@nwl.cc>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Jean, I assume you take that one ?
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds
2011-11-05 17:54 [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds Jean Delvare
2011-11-05 18:16 ` R, Durgadoss
2011-11-05 21:58 ` Guenter Roeck
@ 2011-11-06 9:30 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2011-11-06 9:30 UTC (permalink / raw)
To: lm-sensors
On Sat, 5 Nov 2011 14:58:12 -0700, Guenter Roeck wrote:
> On Sat, Nov 05, 2011 at 01:54:11PM -0400, Jean Delvare wrote:
> > 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.
> >
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > Tested-by: Phil Sutter <phil@nwl.cc>
>
> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Thanks.
> Jean, I assume you take that one ?
Yes I will.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-06 9:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-05 17:54 [lm-sensors] [PATCH] hwmon: (coretemp) Fix for non-SMP builds Jean Delvare
2011-11-05 18:16 ` R, Durgadoss
2011-11-05 21:58 ` Guenter Roeck
2011-11-06 9:30 ` Jean Delvare
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.