]> 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:43:53 +0000 (09:43 +0200)
commita45445b6093d4ffd83bb42da677c29959576fa59
tree0ea679d4e083262f4c02b7aadfdc792eb36ffb45
parent3a868a7f8da4775391c09fcd24898fcb2beb4545
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