[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251107074145.2340-6-gautham.shenoy@amd.com>
Date: Fri, 7 Nov 2025 13:11:45 +0530
From: "Gautham R. Shenoy" <gautham.shenoy@....com>
To: "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
Mario Limonciello <mario.limonciello@....com>, Yunhui Cui
<cuiyunhui@...edance.com>, Jeremy Linton <jeremy.linton@....com>, "Viresh
Kumar" <viresh.kumar@...aro.org>, Ionela Voinescu <ionela.voinescu@....com>
CC: <linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Christopher
Harris" <chris.harris79@...il.com>, <linux-pm@...r.kernel.org>, "Gautham R.
Shenoy" <gautham.shenoy@....com>, "Mario Limonciello (AMD) (kernel.org)"
<superm1@...nel.org>
Subject: [PATCH v2 5/5] cpufreq/amd-pstate: Call cppc_set_auto_sel() only for online CPUs
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@...nel.org>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@....com>
---
drivers/cpufreq/amd-pstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index b44f0f7a5ba1..602e4fa81d6c 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1282,7 +1282,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);
}
--
2.34.1
Powered by blists - more mailing lists