]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs
authorMike Tipton <quic_mdtipton@quicinc.com>
Thu, 15 May 2025 03:53:12 +0000 (20:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:31 +0000 (11:05 +0100)
commitb08e4cebc0348c55d201c9dfb4bd6fc7a31a792b
treea556f6e48c053861b92c0653654fe5d8127ceaa7
parentc0952a626fd94bf93af2edd7f8d3ad3b8da53022
cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs

[ Upstream commit 6c9bb86922728c7a4cceb99f131e00dd87514f20 ]

Currently, all SCMI devices with performance domains attempt to register
a cpufreq driver, even if their performance domains aren't used to
control the CPUs. The cpufreq framework only supports registering a
single driver, so only the first device will succeed. And if that device
isn't used for the CPUs, then cpufreq will scale the wrong domains.

To avoid this, return early from scmi_cpufreq_probe() if the probing
SCMI device isn't referenced by the CPU device phandles.

This keeps the existing assumption that all CPUs are controlled by a
single SCMI device.

Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/scmi-cpufreq.c