Skip to contentSkip to conversation

cpuidle: fix unmet dependencies on ARCH_SUSPEND_POSSIBLE for ARM_CPU_SUSPEND

PATCH In review Julian Braha 2 participants 2 messages Oct 29, 2021 – Nov 5, 2021 CPU idle time management framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuidle: fix unmet dependencies on ARCH_SUSPEND_POSSIBLE for ARM_CPU_SUSPEND

When ARM_TEGRA_CPUIDLE or ARM_QCOM_SPM_CPUIDLE are selected, and ARCH_SUSPEND_POSSIBLE is disabled, Kbuild gives the following warnings:

WARNING: unmet direct dependencies detected for ARM_CPU_SUSPEND
Depends on [n]: ARCH_SUSPEND_POSSIBLE [=n]
Selected by [y]:
- ARM_TEGRA_CPUIDLE [=y] && CPU_IDLE [=y] && (ARM [=y] || ARM64) && (ARCH_TEGRA [=n] || COMPILE_TEST [=y]) && !ARM64 && MMU [=y]

and

WARNING: unmet direct dependencies detected for ARM_CPU_SUSPEND
Depends on [n]: ARCH_SUSPEND_POSSIBLE [=n]
Selected by [y]:
- ARM_QCOM_SPM_CPUIDLE [=y] && CPU_IDLE [=y] && (ARM [=y] || ARM64) && (ARCH_QCOM [=n] || COMPILE_TEST [=y]) && !ARM64 && MMU [=y]

This is because these options enable ARM_CPU_SUSPEND without selecting or depending on ARCH_SUSPEND_POSSIBLE, despite ARM_CPU_SUSPEND depending on ARCH_SUSPEND_POSSIBLE.

These unmet dependency bugs were detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution.

---
 drivers/cpuidle/Kconfig.arm | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpuidle/Kconfig.arm +2 -0
index 15d6c46c0a47..1b4f5ae1ee05 100644
@@ -100,6 +100,7 @@ config ARM_MVEBU_V7_CPUIDLE
 config ARM_TEGRA_CPUIDLE
 	bool "CPU Idle Driver for NVIDIA Tegra SoCs"
 	depends on (ARCH_TEGRA || COMPILE_TEST) && !ARM64 && MMU
+	depends on ARCH_SUSPEND_POSSIBLE
 	select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
 	select ARM_CPU_SUSPEND
 	help
@@ -108,6 +109,7 @@ config ARM_TEGRA_CPUIDLE
 config ARM_QCOM_SPM_CPUIDLE
 	bool "CPU Idle Driver for Qualcomm Subsystem Power Manager (SPM)"
 	depends on (ARCH_QCOM || COMPILE_TEST) && !ARM64 && MMU
+	depends on ARCH_SUSPEND_POSSIBLE
 	select ARM_CPU_SUSPEND
 	select CPU_IDLE_MULTIPLE_DRIVERS
 	select DT_IDLE_STATES
Signature · 1 line
2.30.2
#1 lore raw
Quoted 17 lines · Julian Braha

When ARM_TEGRA_CPUIDLE or ARM_QCOM_SPM_CPUIDLE are selected, and ARCH_SUSPEND_POSSIBLE is disabled, Kbuild gives the following warnings:

WARNING: unmet direct dependencies detected for ARM_CPU_SUSPEND
Depends on [n]: ARCH_SUSPEND_POSSIBLE [=n]
Selected by [y]:
- ARM_TEGRA_CPUIDLE [=y] && CPU_IDLE [=y] && (ARM [=y] || ARM64) && (ARCH_TEGRA [=n] || COMPILE_TEST [=y]) && !ARM64 && MMU [=y]

and

WARNING: unmet direct dependencies detected for ARM_CPU_SUSPEND
Depends on [n]: ARCH_SUSPEND_POSSIBLE [=n]
Selected by [y]:
- ARM_QCOM_SPM_CPUIDLE [=y] && CPU_IDLE [=y] && (ARM [=y] || ARM64) && (ARCH_QCOM [=n] || COMPILE_TEST [=y]) && !ARM64 && MMU [=y]

Quoted 7 lines

This is because these options enable ARM_CPU_SUSPEND without selecting or depending on ARCH_SUSPEND_POSSIBLE, despite ARM_CPU_SUSPEND depending on ARCH_SUSPEND_POSSIBLE.

These unmet dependency bugs were detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution.

The changes make sense to me, but I need the maintainers of the two affected platforms to tell me that this is OK.

Quoted 28 lines
---
 drivers/cpuidle/Kconfig.arm | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpuidle/Kconfig.arm +2 -1
index 15d6c46c0a47..1b4f5ae1ee05 100644
@@ -100,6 +100,7 @@ config ARM_MVEBU_V7_CPUIDLE
 config ARM_TEGRA_CPUIDLE
        bool "CPU Idle Driver for NVIDIA Tegra SoCs"
        depends on (ARCH_TEGRA || COMPILE_TEST) && !ARM64 && MMU
+       depends on ARCH_SUSPEND_POSSIBLE
        select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
        select ARM_CPU_SUSPEND
        help
@@ -108,6 +109,7 @@ config ARM_TEGRA_CPUIDLE
 config ARM_QCOM_SPM_CPUIDLE
        bool "CPU Idle Driver for Qualcomm Subsystem Power Manager (SPM)"
        depends on (ARCH_QCOM || COMPILE_TEST) && !ARM64 && MMU
+       depends on ARCH_SUSPEND_POSSIBLE
        select ARM_CPU_SUSPEND
        select CPU_IDLE_MULTIPLE_DRIVERS
        select DT_IDLE_STATES
--

2.30.2