Skip to content

Commit 5ce1a10

Browse files
committed
cpuidle: psci: Enable the hierarchical topology for s2idle on PREEMPT_RT
JIRA: https://issues.redhat.com/browse/RHEL-64032 commit 1c4b293 Author: Ulf Hansson <ulf.hansson@linaro.org> Date: Mon, 05 Aug 2024 13:25:45 +0000 To enable the domain-idle-states to be used during s2idle on a PREEMPT_RT based configuration, let's allow the re-assignment of the ->enter_s2idle() callback to psci_enter_s2idle_domain_idle_state(). Similar to s2ram, let's leave the support for CPU hotplug outside PREEMPT_RT, as it's depending on using runtime PM. For s2idle, this means that an offline CPU's PM domain will remain powered-on. In practise this may lead to that a shallower idle-state than necessary gets selected, which shouldn't be an issue (besides wasting power). 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-8-ulf.hansson@linaro.org Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 95fa49c commit 5ce1a10

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/cpuidle/cpuidle-psci.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,17 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv,
233233

234234
psci_cpuidle_use_syscore = true;
235235

236-
/* The hierarchical topology is limited to s2ram on PREEMPT_RT. */
237-
if (IS_ENABLED(CONFIG_PREEMPT_RT))
238-
return 0;
239-
240236
/*
241237
* Using the deepest state for the CPU to trigger a potential selection
242238
* of a shared state for the domain, assumes the domain states are all
243-
* deeper states.
239+
* deeper states. On PREEMPT_RT the hierarchical topology is limited to
240+
* s2ram and s2idle.
244241
*/
245-
drv->states[state_count - 1].enter = psci_enter_domain_idle_state;
246242
drv->states[state_count - 1].enter_s2idle = psci_enter_s2idle_domain_idle_state;
247-
psci_cpuidle_use_cpuhp = true;
243+
if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
244+
drv->states[state_count - 1].enter = psci_enter_domain_idle_state;
245+
psci_cpuidle_use_cpuhp = true;
246+
}
248247

249248
return 0;
250249
}

0 commit comments

Comments
 (0)