Re: [PATCH 4/5] s390/idle: Introduce cpuidle for s390

From: Christian Loehle

Date: Tue Jun 09 2026 - 04:15:21 EST


On 6/9/26 08:52, Mete Durlu wrote:
> Introduce generic cpuidle driver on s390. Use a two stage approach to
> handle idle scenarios and use TEO governor for idle stage selection.
> Two stages are, from shallow to deep, idle polling and enabled wait.
>
> Suggested-by: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>
> Suggested-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
> Signed-off-by: Mete Durlu <meted@xxxxxxxxxxxxx>
> ---
> arch/s390/Kconfig | 5 ++
> drivers/cpuidle/Kconfig | 5 ++
> drivers/cpuidle/Kconfig.s390 | 12 ++++
> drivers/cpuidle/Makefile | 4 ++
> drivers/cpuidle/cpuidle-s390.c | 104 +++++++++++++++++++++++++++++++++
> 5 files changed, 130 insertions(+)
> create mode 100644 drivers/cpuidle/Kconfig.s390
> create mode 100644 drivers/cpuidle/cpuidle-s390.c
>
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index ecbcbb781e40..8548f5b6b247 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -20,6 +20,9 @@ config ARCH_HAS_ILOG2_U64
> config ARCH_PROC_KCORE_TEXT
> def_bool y
>
> +config ARCH_HAS_CPU_RELAX
> + def_bool y
> +
> config GENERIC_HWEIGHT
> def_bool !HAVE_MARCH_Z196_FEATURES
>
> @@ -708,6 +711,8 @@ config KERNEL_IMAGE_BASE
>
> endmenu
>
> +source "drivers/cpuidle/Kconfig"
> +
> menu "Memory setup"
>
> config ARCH_SPARSEMEM_ENABLE
> diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig
> index d6d8386d3f02..00e2562041fd 100644
> --- a/drivers/cpuidle/Kconfig
> +++ b/drivers/cpuidle/Kconfig
> @@ -71,6 +71,11 @@ depends on RISCV
> source "drivers/cpuidle/Kconfig.riscv"
> endmenu
>
> +menu "S390 CPU Idle Drivers"
> +depends on S390
> +source "drivers/cpuidle/Kconfig.s390"
> +endmenu
> +
> config HALTPOLL_CPUIDLE
> tristate "Halt poll cpuidle driver"
> depends on X86 && KVM_GUEST
> diff --git a/drivers/cpuidle/Kconfig.s390 b/drivers/cpuidle/Kconfig.s390
> new file mode 100644
> index 000000000000..e51704a9304c
> --- /dev/null
> +++ b/drivers/cpuidle/Kconfig.s390
> @@ -0,0 +1,12 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +#
> +# S390 CPU Idle drivers
> +#
> +
> +config S390_CPUIDLE
> + bool "S390 CPU idle driver"
> + default y
> + help
> + Select this option to enable processor idle state management
> + through cpuidle subsystem.
> +
NIT:
git complains about the trailing blank line here.