summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/mvebu-cpufreq.c
diff options
context:
space:
mode:
authorJacky Bai <ping.bai@nxp.com>2025-03-13 09:39:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:43:58 +0200
commitde2530c4133fbeff459e4d9407c64067779a37a6 (patch)
tree3c6937d02a8a39df3619d1f06c45cb1a4e1133ec /drivers/cpufreq/mvebu-cpufreq.c
parent8fe0068e9517f126c176d5756093c113e3b80979 (diff)
downloadlinux-de2530c4133fbeff459e4d9407c64067779a37a6.tar.gz
linux-de2530c4133fbeff459e4d9407c64067779a37a6.tar.bz2
linux-de2530c4133fbeff459e4d9407c64067779a37a6.zip
cpufreq: Init cpufreq only for present CPUs
[ Upstream commit 45f589b7167f36290d29c79e3a442dc0b13c086a ] for_each_possible_cpu() is currently used to initialize cpufreq. However, in cpu_dev_register_generic(), for_each_present_cpu() is used to register CPU devices which means the CPU devices are only registered for present CPUs and not all possible CPUs. With nosmp or maxcpus=0, only the boot CPU is present, lead to the cpufreq probe failure or defer probe due to no cpu device available for not present CPUs. Change for_each_possible_cpu() to for_each_present_cpu() in the above cpufreq drivers to ensure it only registers cpufreq for CPUs that are actually present. Fixes: b0c69e1214bc ("drivers: base: Use present CPUs in GENERIC_CPU_DEVICES") Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jacky Bai <ping.bai@nxp.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/cpufreq/mvebu-cpufreq.c')
-rw-r--r--drivers/cpufreq/mvebu-cpufreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/mvebu-cpufreq.c b/drivers/cpufreq/mvebu-cpufreq.c
index 7f3cfe668f30..2aad4c04673c 100644
--- a/drivers/cpufreq/mvebu-cpufreq.c
+++ b/drivers/cpufreq/mvebu-cpufreq.c
@@ -56,7 +56,7 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
* it), and registers the clock notifier that will take care
* of doing the PMSU part of a frequency transition.
*/
- for_each_possible_cpu(cpu) {
+ for_each_present_cpu(cpu) {
struct device *cpu_dev;
struct clk *clk;
int ret;