]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/intel-uncore-freq: Fix missing uncore sysfs during CPU hotplug
authorShouye Liu <shouyeliu@tencent.com>
Thu, 17 Apr 2025 03:23:21 +0000 (11:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:41:36 +0000 (09:41 +0200)
commitcf443f314509cff8539c6d73b81e2d55bc061992
treea0e233c25f7863ef64e028317c674107c00c01db
parent810947bfbb56e65488649dc08adb14e228f27947
platform/x86/intel-uncore-freq: Fix missing uncore sysfs during CPU hotplug

commit 8d6955ed76e8a47115f2ea1d9c263ee6f505d737 upstream.

In certain situations, the sysfs for uncore may not be present when all
CPUs in a package are offlined and then brought back online after boot.

This issue can occur if there is an error in adding the sysfs entry due
to a memory allocation failure. Retrying to bring the CPUs online will
not resolve the issue, as the uncore_cpu_mask is already set for the
package before the failure condition occurs.

This issue does not occur if the failure happens during module
initialization, as the module will fail to load in the event of any
error.

To address this, ensure that the uncore_cpu_mask is not set until the
successful return of uncore_freq_add_entry().

Fixes: dbce412a7733 ("platform/x86/intel-uncore-freq: Split common and enumeration part")
Signed-off-by: Shouye Liu <shouyeliu@tencent.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250417032321.75580-1-shouyeliu@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c