]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: Init cpufreq only for present CPUs
authorJacky Bai <ping.bai@nxp.com>
Thu, 13 Mar 2025 01:39:28 +0000 (09:39 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 17 Mar 2025 05:59:18 +0000 (11:29 +0530)
commit45f589b7167f36290d29c79e3a442dc0b13c086a
tree6d5a950044c269256f30ce1bc9c8e5239883f76d
parentbe4ae8c19492cd6d5de61ccb34ffb3f5ede5eec8
cpufreq: Init cpufreq only for present CPUs

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>
drivers/cpufreq/armada-8k-cpufreq.c
drivers/cpufreq/cpufreq-dt.c
drivers/cpufreq/mediatek-cpufreq-hw.c
drivers/cpufreq/mediatek-cpufreq.c
drivers/cpufreq/mvebu-cpufreq.c
drivers/cpufreq/qcom-cpufreq-hw.c
drivers/cpufreq/qcom-cpufreq-nvmem.c
drivers/cpufreq/scmi-cpufreq.c
drivers/cpufreq/scpi-cpufreq.c
drivers/cpufreq/sun50i-cpufreq-nvmem.c
drivers/cpufreq/virtual-cpufreq.c