umber-kernel/drivers/cpuidle
Aboorva Devarajan 63ae78336f cpuidle: Skip governor when only one idle state is available
[ 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: dc2251bf98 ("cpuidle: Eliminate the CPUIDLE_DRIVER_STATE_START symbol")
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/20260216185005.1131593-2-aboorvad@linux.ibm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-02-26 14:59:36 -08:00
..
governors cpuidle: governors: menu: Always check timers with tick stopped 2026-02-26 14:59:00 -08:00
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
coupled.c
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-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: Drop redundant sync_state support 2025-07-09 13:30:01 +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: qcom-spm: drop unnecessary initialisations 2025-09-10 12:49:52 +02:00
cpuidle-riscv-sbi.c cpuidle: riscv-sbi: Replace deprecated strcpy in sbi_cpuidle_init_cpu 2025-10-27 23:38:13 -06:00
cpuidle-tegra.c
cpuidle-ux500.c
cpuidle-zynq.c
cpuidle.c cpuidle: Skip governor when only one idle state is available 2026-02-26 14:59:36 -08:00
cpuidle.h
driver.c cpuidle: Correct some typos in comments 2024-10-18 18:44:32 +02:00
dt_idle_genpd.c
dt_idle_genpd.h
dt_idle_states.c cpuidle: dt: fix opencoded for_each_cpu() in idle_state_valid() 2025-07-10 14:53:28 +02:00
dt_idle_states.h
governor.c
poll_state.c
sysfs.c cpuidle: sysfs: Use sysfs_emit()/sysfs_emit_at() instead of sprintf()/scnprintf() 2025-09-20 13:06:37 +02:00