]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpuidle: qcom-spm: Check if any CPU is managed by SPM
authorStephan Gerhold <stephan@gerhold.net>
Wed, 1 Dec 2021 13:05:02 +0000 (14:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:46 +0000 (13:57 +0200)
commitc09f1248b13fa956f27229655be05bc5d6fe4fa2
tree55617881b8043dd94eb7d2c5071ce284f123556d
parent03e01cdcbb9059664b2f5a4639aea6a0b1642d84
cpuidle: qcom-spm: Check if any CPU is managed by SPM

[ Upstream commit 0ee30ace67e425ab83a1673bf51f50b577328cf9 ]

At the moment, the "qcom-spm-cpuidle" platform device is always created,
even if none of the CPUs is actually managed by the SPM. On non-qcom
platforms this will result in infinite probe-deferral due to the
failing qcom_scm_is_available() call.

To avoid this, look through the CPU DT nodes and check if there is
actually any CPU managed by a SPM (as indicated by the qcom,saw property).
It should also be available because e.g. MSM8916 has qcom,saw defined
but it's typically not enabled with ARM64/PSCI firmwares.

This is needed in preparation of a follow-up change that calls
qcom_scm_set_warm_boot_addr() a single time before registering any
cpuidle drivers. Otherwise this call might be made even on devices
that have this driver enabled but actually make use of PSCI.

Fixes: 60f3692b5f0b ("cpuidle: qcom_spm: Detach state machine from main SPM handling")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/86e3e09f-a8d7-3dff-3fc6-ddd7d30c5d78@samsung.com/
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211201130505.257379-2-stephan@gerhold.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpuidle/cpuidle-qcom-spm.c