OSDN Git Service

cpuidle: psci: Move enabling OSI mode after power domains creation
authorMaulik Shah <quic_mkshah@quicinc.com>
Mon, 3 Jul 2023 08:55:54 +0000 (14:25 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 8 Aug 2023 14:07:01 +0000 (16:07 +0200)
commit12acb348fa4528a4203edf1cce7a3be2c9af2279
treea0e7cfe82fa42f3129711a499206598cd51c640f
parent9a8fa00dad3c7b260071f2f220cfb00505372c40
cpuidle: psci: Move enabling OSI mode after power domains creation

A switch from OSI to PC mode is only possible if all CPUs other than the
calling one are OFF, either through a call to CPU_OFF or not yet booted.

Currently OSI mode is enabled before power domains are created. In cases
where CPUidle states are not using hierarchical CPU topology the bail out
path tries to switch back to PC mode which gets denied by firmware since
other CPUs are online at this point and creates inconsistent state as
firmware is in OSI mode and Linux in PC mode.

This change moves enabling OSI mode after power domains are created,
this would makes sure that hierarchical CPU topology is used before
switching firmware to OSI mode.

Cc: stable@vger.kernel.org
Fixes: 70c179b49870 ("cpuidle: psci: Allow PM domain to be initialized even if no OSI mode")
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/cpuidle/cpuidle-psci-domain.c