linux-yocto/drivers/cpuidle
Daniel Lezcano 621a88dbfe cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y
Currently cpu hotplug with the PREEMPT_RT option set in the kernel is
not supported because the underlying generic power domain functions
used in the cpu hotplug callbacks are incompatible from a lock point
of view. This situation prevents the suspend to idle to reach the
deepest idle state for the "cluster" as identified in the
undermentioned commit.

Use the compatible ones when PREEMPT_RT is enabled and remove the
boolean disabling the hotplug callbacks with this option.

With this change the platform can reach the deepest idle state
allowing at suspend time to consume less power.

Tested-on Lenovo T14s with the following script:

echo 0 > /sys/devices/system/cpu/cpu3/online
BEFORE=$(cat /sys/kernel/debug/pm_genpd/power-domain-cpu-cluster0/idle_states | grep S0 | awk '{ print $3 }') ;
rtcwake -s 1 -m mem;
AFTER=$(cat /sys/kernel/debug/pm_genpd/power-domain-cpu-cluster0/idle_states | grep S0 | awk '{ print $3 }');
if [ $BEFORE -lt $AFTER ]; then
    echo "Test successful"
else
    echo "Test failed"
fi
echo 1 > /sys/devices/system/cpu/cpu3/online

Fixes: 1c4b2932bd ("cpuidle: psci: Enable the hierarchical topology for s2idle on PREEMPT_RT")
Cc: Raghavendra Kakarla <quic_rkakarla@quicinc.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250709154728.733920-1-daniel.lezcano@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2025-07-14 13:09:04 +02:00
..
governors cpuidle: menu: Optimize bucket assignment when next_timer_ns equals KTIME_MAX 2025-04-09 19:37:30 +02:00
coupled.c cpuidle: Avoid explicit cpumask allocation on stack 2024-04-24 21:23:49 +02:00
cpuidle-arm.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-at91.c
cpuidle-big_little.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-calxeda.c
cpuidle-clps711x.c
cpuidle-cps.c
cpuidle-exynos.c
cpuidle-haltpoll.c cpuidle: haltpoll: add missing MODULE_DESCRIPTION() macro 2024-06-14 18:15:38 +02:00
cpuidle-kirkwood.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
cpuidle-mvebu-v7.c
cpuidle-powernv.c
cpuidle-psci-domain.c cpuidle: psci: Correct the domain-idlestate statistics in debugfs 2025-04-23 10:08:34 +02:00
cpuidle-psci.c cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y 2025-07-14 13:09:04 +02:00
cpuidle-psci.h cpuidle: psci: Correct the domain-idlestate statistics in debugfs 2025-04-23 10:08:34 +02:00
cpuidle-pseries.c powerpc/machdep: Drop include of dma-mapping.h 2024-10-29 23:01:05 +11:00
cpuidle-qcom-spm.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-riscv-sbi.c cpuidle: Init cpuidle only for present CPUs 2025-03-12 21:31:59 +01:00
cpuidle-tegra.c
cpuidle-ux500.c
cpuidle-zynq.c
cpuidle.c cpuidle: Do not return from cpuidle_play_dead() on callback failures 2024-11-19 21:46:51 +01:00
cpuidle.h
driver.c cpuidle: Correct some typos in comments 2024-10-18 18:44:32 +02:00
dt_idle_genpd.c cpuidle: dt_idle_genpd: Simplify with scoped for each OF child loop 2024-08-20 11:30:39 +02:00
dt_idle_genpd.h
dt_idle_states.c cpuidle: dt: Replace deprecated strncpy() with strscpy() 2023-09-29 14:48:31 -07:00
dt_idle_states.h
governor.c
Kconfig
Kconfig.arm
Kconfig.mips
Kconfig.powerpc
Kconfig.riscv
Makefile tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
poll_state.c
sysfs.c