[ Upstream commit e5c9ffc6ae1bcdb1062527d611043681ac301aca ]
On certain platforms (PowerNV systems without a power-mgt DT node),
cpuidle may register only a single idle state. In cases where that
single state is a polling state (state 0), the ladder governor may
incorrectly treat state 1 as the first usable state and pass an
out-of-bounds index. This can lead to a NULL enter callback being
invoked, ultimately resulting in a system crash.
[ 13.342636] cpuidle-powernv : Only Snooze is available
[ 13.351854] Faulting instruction address: 0x00000000
[ 13.376489] NIP [0000000000000000] 0x0
[ 13.378351] LR [c000000001e01974] cpuidle_enter_state+0x2c4/0x668
Fix this by adding a bail-out in cpuidle_select() that returns state 0
directly when state_count <= 1, bypassing the governor and keeping the
tick running.
Fixes:
|
||
|---|---|---|
| .. | ||
| governors | ||
| Kconfig | ||
| Kconfig.arm | ||
| Kconfig.mips | ||
| Kconfig.powerpc | ||
| Kconfig.riscv | ||
| Makefile | ||
| coupled.c | ||
| 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-kirkwood.c | ||
| cpuidle-mvebu-v7.c | ||
| cpuidle-powernv.c | ||
| cpuidle-psci-domain.c | ||
| cpuidle-psci.c | ||
| cpuidle-psci.h | ||
| cpuidle-pseries.c | ||
| cpuidle-qcom-spm.c | ||
| cpuidle-riscv-sbi.c | ||
| cpuidle-tegra.c | ||
| cpuidle-ux500.c | ||
| cpuidle-zynq.c | ||
| cpuidle.c | ||
| cpuidle.h | ||
| driver.c | ||
| dt_idle_genpd.c | ||
| dt_idle_genpd.h | ||
| dt_idle_states.c | ||
| dt_idle_states.h | ||
| governor.c | ||
| poll_state.c | ||
| sysfs.c | ||