[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70ca3e55-036b-4603-b744-f367f4de6344@roeck-us.net>
Date: Sat, 3 Feb 2024 07:16:55 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Zhang Rui <rui.zhang@...el.com>
Cc: jdelvare@...e.com, fenghua.yu@...el.com, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 02/11] hwmon: (coretemp) Fix bogus core_id to attr
name mapping
On Fri, Feb 02, 2024 at 05:21:35PM +0800, Zhang Rui wrote:
> Before commit 7108b80a542b ("hwmon/coretemp: Handle large core ID
> value"), there is a fixed mapping between
> 1. cpu_core_id
> 2. the index in pdata->core_data[] array
> 3. the sysfs attr name, aka "tempX_"
> The later two always equal cpu_core_id + 2.
>
> After the commit, pdata->core_data[] index is got from ida so that it
> can handle sparse core ids and support more cores within a package.
>
> However, the commit erroneously maps the sysfs attr name to
> pdata->core_data[] index instead of cpu_core_id + 2.
>
> As a result, the code is not aligned with the comments, and brings user
> visible changes in hwmon sysfs on systems with sparse core id.
>
> For example, before commit 7108b80a542b ("hwmon/coretemp: Handle large
> core ID value"),
> /sys/class/hwmon/hwmon2/temp2_label:Core 0
> /sys/class/hwmon/hwmon2/temp3_label:Core 1
> /sys/class/hwmon/hwmon2/temp4_label:Core 2
> /sys/class/hwmon/hwmon2/temp5_label:Core 3
> /sys/class/hwmon/hwmon2/temp6_label:Core 4
> /sys/class/hwmon/hwmon3/temp10_label:Core 8
> /sys/class/hwmon/hwmon3/temp11_label:Core 9
> after commit,
> /sys/class/hwmon/hwmon2/temp2_label:Core 0
> /sys/class/hwmon/hwmon2/temp3_label:Core 1
> /sys/class/hwmon/hwmon2/temp4_label:Core 2
> /sys/class/hwmon/hwmon2/temp5_label:Core 3
> /sys/class/hwmon/hwmon2/temp6_label:Core 4
> /sys/class/hwmon/hwmon2/temp7_label:Core 8
> /sys/class/hwmon/hwmon2/temp8_label:Core 9
>
> Restore the previous behavior and rework the code, comments and variable
> names to avoid future confusions.
>
> Fixes: 7108b80a542b ("hwmon/coretemp: Handle large core ID value")
> Signed-off-by: Zhang Rui <rui.zhang@...el.com>
Applied.
Thanks,
Guenter
Powered by blists - more mailing lists