]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon/coretemp: Handle large core ID value
authorZhang Rui <rui.zhang@intel.com>
Fri, 14 Oct 2022 09:01:45 +0000 (17:01 +0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Mon, 17 Oct 2022 18:58:52 +0000 (11:58 -0700)
commit2a9e28e11a861dc5fdb91f25679e8a1d4819973d
tree48e0da1d04740ba5112ef21f7091d5bd857da2a1
parentfb18eb30c1d3f2a6bba16a43b8e20412366f0d48
hwmon/coretemp: Handle large core ID value

The coretemp driver supports up to a hard-coded limit of 128 cores.

Today, the driver can not support a core with an ID above that limit.
Yet, the encoding of core ID's is arbitrary (BIOS APIC-ID) and so they
may be sparse and they may be large.

Update the driver to map arbitrary core ID numbers into appropriate
array indexes so that 128 cores can be supported, no matter the encoding
of core ID's.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20221014090147.1836-3-rui.zhang@intel.com
drivers/hwmon/coretemp.c