All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads
@ 2016-09-13  5:47 Michael Neuling
  2016-09-13  6:07 ` Cédric Le Goater
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Neuling @ 2016-09-13  5:47 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Cédric Le Goater, linux-hwmon, Andrew Jeffery, me

Currently the label says "Core" but lists the thread numbers. This
ends up looking like this:
    # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
    Core 0-7
    Core 8-15
    Core 16-23
    Core 24-31

This is misleading as it looks like it's cores 0-7 when it's actually
threads 0-7.

This changes the print to just give the core number, so the output now
looks like this:
    # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
    Core 0
    Core 8
    Core 16
    Core 24

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 drivers/hwmon/ibmpowernv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
index 55b5a8ff1c..6d2e660575 100644
--- a/drivers/hwmon/ibmpowernv.c
+++ b/drivers/hwmon/ibmpowernv.c
@@ -143,13 +143,11 @@ static void __init make_sensor_label(struct device_node *np,
 		if (cpuid >= 0)
 			/*
 			 * The digital thermal sensors are associated
-			 * with a core. Let's print out the range of
-			 * cpu ids corresponding to the hardware
-			 * threads of the core.
+			 * with a core.
 			 */
 			n += snprintf(sdata->label + n,
-				      sizeof(sdata->label) - n, " %d-%d",
-				      cpuid, cpuid + threads_per_core - 1);
+				      sizeof(sdata->label) - n, " %d",
+				      cpuid);
 		else
 			n += snprintf(sdata->label + n,
 				      sizeof(sdata->label) - n, " phy%d", id);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads
  2016-09-13  5:47 [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads Michael Neuling
@ 2016-09-13  6:07 ` Cédric Le Goater
  2016-09-13 14:28   ` Guenter Roeck
  2016-09-14  1:14   ` Michael Neuling
  0 siblings, 2 replies; 4+ messages in thread
From: Cédric Le Goater @ 2016-09-13  6:07 UTC (permalink / raw)
  To: Michael Neuling, Guenter Roeck; +Cc: linux-hwmon, Andrew Jeffery, me

On 09/13/2016 07:47 AM, Michael Neuling wrote:
> Currently the label says "Core" but lists the thread numbers. This
> ends up looking like this:
>     # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
>     Core 0-7
>     Core 8-15
>     Core 16-23
>     Core 24-31
> 
> This is misleading as it looks like it's cores 0-7 when it's actually
> threads 0-7.
> 
> This changes the print to just give the core number, so the output now
> looks like this:
>     # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
>     Core 0
>     Core 8
>     Core 16
>     Core 24
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>

Yes. This looks better. The DTS are related to the core so we don't 
really care about the threads.

Acked-by: Cédric Le Goater <clg@kaod.org>



Side question, should we use the Physical ID and not the Linux 
logical one ? I don't know if it is exposed elsewhere in user space.

Thanks,

C.


> ---
>  drivers/hwmon/ibmpowernv.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
> index 55b5a8ff1c..6d2e660575 100644
> --- a/drivers/hwmon/ibmpowernv.c
> +++ b/drivers/hwmon/ibmpowernv.c
> @@ -143,13 +143,11 @@ static void __init make_sensor_label(struct device_node *np,
>  		if (cpuid >= 0)
>  			/*
>  			 * The digital thermal sensors are associated
> -			 * with a core. Let's print out the range of
> -			 * cpu ids corresponding to the hardware
> -			 * threads of the core.
> +			 * with a core.
>  			 */
>  			n += snprintf(sdata->label + n,
> -				      sizeof(sdata->label) - n, " %d-%d",
> -				      cpuid, cpuid + threads_per_core - 1);
> +				      sizeof(sdata->label) - n, " %d",
> +				      cpuid);
>  		else
>  			n += snprintf(sdata->label + n,
>  				      sizeof(sdata->label) - n, " phy%d", id);
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads
  2016-09-13  6:07 ` Cédric Le Goater
@ 2016-09-13 14:28   ` Guenter Roeck
  2016-09-14  1:14   ` Michael Neuling
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2016-09-13 14:28 UTC (permalink / raw)
  To: Cédric Le Goater, Michael Neuling; +Cc: linux-hwmon, Andrew Jeffery, me

On 09/12/2016 11:07 PM, Cédric Le Goater wrote:
> On 09/13/2016 07:47 AM, Michael Neuling wrote:
>> Currently the label says "Core" but lists the thread numbers. This
>> ends up looking like this:
>>     # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
>>     Core 0-7
>>     Core 8-15
>>     Core 16-23
>>     Core 24-31
>>
>> This is misleading as it looks like it's cores 0-7 when it's actually
>> threads 0-7.
>>
>> This changes the print to just give the core number, so the output now
>> looks like this:
>>     # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
>>     Core 0
>>     Core 8
>>     Core 16
>>     Core 24
>>
>> Signed-off-by: Michael Neuling <mikey@neuling.org>
>
> Yes. This looks better. The DTS are related to the core so we don't
> really care about the threads.
>
> Acked-by: Cédric Le Goater <clg@kaod.org>
>
>
Applied to -next.

Guenter

>
> Side question, should we use the Physical ID and not the Linux
> logical one ? I don't know if it is exposed elsewhere in user space.
>
> Thanks,
>
> C.
>
>
>> ---
>>  drivers/hwmon/ibmpowernv.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
>> index 55b5a8ff1c..6d2e660575 100644
>> --- a/drivers/hwmon/ibmpowernv.c
>> +++ b/drivers/hwmon/ibmpowernv.c
>> @@ -143,13 +143,11 @@ static void __init make_sensor_label(struct device_node *np,
>>  		if (cpuid >= 0)
>>  			/*
>>  			 * The digital thermal sensors are associated
>> -			 * with a core. Let's print out the range of
>> -			 * cpu ids corresponding to the hardware
>> -			 * threads of the core.
>> +			 * with a core.
>>  			 */
>>  			n += snprintf(sdata->label + n,
>> -				      sizeof(sdata->label) - n, " %d-%d",
>> -				      cpuid, cpuid + threads_per_core - 1);
>> +				      sizeof(sdata->label) - n, " %d",
>> +				      cpuid);
>>  		else
>>  			n += snprintf(sdata->label + n,
>>  				      sizeof(sdata->label) - n, " phy%d", id);
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads
  2016-09-13  6:07 ` Cédric Le Goater
  2016-09-13 14:28   ` Guenter Roeck
@ 2016-09-14  1:14   ` Michael Neuling
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Neuling @ 2016-09-14  1:14 UTC (permalink / raw)
  To: Cédric Le Goater, Guenter Roeck; +Cc: linux-hwmon, Andrew Jeffery


> > Signed-off-by: Michael Neuling <mikey@neuling.org>
> Yes. This looks better. The DTS are related to the core so we don't 
> really care about the threads.
> 
> Acked-by: Cédric Le Goater <clg@kaod.org>

Thanks

> 
> Side question, should we use the Physical ID and not the Linux 
> logical one ? I don't know if it is exposed elsewhere in user space.

Yeah Linux logical is what the user sees for sysfs interfaces, /proc/cpuinfo,
taskset etc so that makes more sense than physical.

Mikey

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-14  1:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13  5:47 [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads Michael Neuling
2016-09-13  6:07 ` Cédric Le Goater
2016-09-13 14:28   ` Guenter Roeck
2016-09-14  1:14   ` Michael Neuling

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.