summaryrefslogtreecommitdiff
path: root/drivers/cpuidle/cpuidle-psci-domain.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2024-05-27 16:25:54 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2024-08-05 13:23:34 +0200
commitc7b45284ab3012d21a02cf4448df32c655c32afb (patch)
tree0f51a124753a0979a9989037bc25195240f65e59 /drivers/cpuidle/cpuidle-psci-domain.c
parent9094e53ff5c86ebe372ad3960c3216c9817a1a04 (diff)
downloadlwn-c7b45284ab3012d21a02cf4448df32c655c32afb.tar.gz
lwn-c7b45284ab3012d21a02cf4448df32c655c32afb.zip
cpuidle: psci-domain: Enable system-wide suspend on PREEMPT_RT
The domain-idle-states are currently disabled on a PREEMPT_RT based configuration for the cpuidle-psci-domain. To enable them to be used for system-wide suspend and in particular during s2idle, let's set the GENPD_FLAG_RPM_ALWAYS_ON instead of GENPD_FLAG_ALWAYS_ON for the corresponding genpd provider. In this way, the runtime PM path remains disabled in genpd for its attached devices, while powering-on/off the PM domain during system-wide suspend becomes allowed. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Raghavendra Kakarla <quic_rkakarla@quicinc.com> # qcm6490 with PREEMPT_RT set Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lore.kernel.org/r/20240527142557.321610-5-ulf.hansson@linaro.org
Diffstat (limited to 'drivers/cpuidle/cpuidle-psci-domain.c')
-rw-r--r--drivers/cpuidle/cpuidle-psci-domain.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index fae958794339..ea28b73ef3fb 100644
--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -67,12 +67,16 @@ static int psci_pd_init(struct device_node *np, bool use_osi)
/*
* Allow power off when OSI has been successfully enabled.
- * PREEMPT_RT is not yet ready to enter domain idle states.
+ * On a PREEMPT_RT based configuration the domain idle states are
+ * supported, but only during system-wide suspend.
*/
- if (use_osi && !IS_ENABLED(CONFIG_PREEMPT_RT))
+ if (use_osi) {
pd->power_off = psci_pd_power_off;
- else
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
+ pd->flags |= GENPD_FLAG_RPM_ALWAYS_ON;
+ } else {
pd->flags |= GENPD_FLAG_ALWAYS_ON;
+ }
/* Use governor for CPU PM domains if it has some states to manage. */
pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;