linux-yocto/drivers/cpuidle
Daniel Lezcano 573f1e5902 cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y
commit 621a88dbfe upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-24 08:56:25 +02:00
..
governors cpuidle: menu: Avoid discarding useful information 2025-05-29 11:02:38 +02:00
coupled.c cpuidle: Avoid explicit cpumask allocation on stack 2024-04-24 21:23:49 +02:00
cpuidle-arm.c
cpuidle-at91.c
cpuidle-big_little.c
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 cpuidle: kirkwood: Convert to platform remove callback returning void 2024-04-23 09:21:48 +02:00
cpuidle-mvebu-v7.c
cpuidle-powernv.c
cpuidle-psci-domain.c cpuidle: psci: Simplify with scoped for each OF child loop 2024-08-20 11:30:39 +02:00
cpuidle-psci.c cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y 2025-07-24 08:56:25 +02:00
cpuidle-psci.h
cpuidle-pseries.c
cpuidle-qcom-spm.c
cpuidle-riscv-sbi.c cpuidle: riscv-sbi: fix device node release in early exit of for_each_possible_cpu 2025-01-17 13:40:44 +01:00
cpuidle-tegra.c
cpuidle-ux500.c
cpuidle-zynq.c
cpuidle.c cpuidle: remove dead code from cpuidle_enter_state() 2024-08-22 21:03:52 +02:00
cpuidle.h
driver.c
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
dt_idle_states.h
governor.c
Kconfig
Kconfig.arm
Kconfig.mips
Kconfig.powerpc
Kconfig.riscv
Makefile
poll_state.c
sysfs.c