summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorGautham R. Shenoy <gautham.shenoy@amd.com>2025-11-07 13:11:45 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-18 13:54:56 +0100
commit37d511e84913930c472c4cbba83ba39024a94e88 (patch)
tree3520c7c3a7a326363a28079bbc5ee1b8a36b54ae /drivers/cpufreq
parent90138ed922e5745ab448912482c61cd82dd2f911 (diff)
downloadlinux-37d511e84913930c472c4cbba83ba39024a94e88.tar.gz
linux-37d511e84913930c472c4cbba83ba39024a94e88.tar.bz2
linux-37d511e84913930c472c4cbba83ba39024a94e88.zip
cpufreq/amd-pstate: Call cppc_set_auto_sel() only for online CPUs
[ Upstream commit bb31fef0d03ed17d587b40e3458786be408fb9df ] amd_pstate_change_mode_without_dvr_change() calls cppc_set_auto_sel() for all the present CPUs. However, this callpath eventually calls cppc_set_reg_val() which accesses the per-cpu cpc_desc_ptr object. This object is initialized only for online CPUs via acpi_soft_cpu_online() --> __acpi_processor_start() --> acpi_cppc_processor_probe(). Hence, restrict calling cppc_set_auto_sel() to only the online CPUs. Fixes: 3ca7bc818d8c ("cpufreq: amd-pstate: Add guided mode control support via sysfs") Suggested-by: Mario Limonciello (AMD) (kernel.org) <superm1@kernel.org> Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/amd-pstate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 62dbc5701e99..c0e073b0425e 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1221,7 +1221,7 @@ static int amd_pstate_change_mode_without_dvr_change(int mode)
if (cpu_feature_enabled(X86_FEATURE_CPPC) || cppc_state == AMD_PSTATE_ACTIVE)
return 0;
- for_each_present_cpu(cpu) {
+ for_each_online_cpu(cpu) {
cppc_set_auto_sel(cpu, (cppc_state == AMD_PSTATE_PASSIVE) ? 0 : 1);
}