2022-04-11 07:18:23

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH] RISC-V: cpuidle: fix Kconfig select for RISCV_SBI_CPUIDLE

There can be lots of build errors when building cpuidle-riscv-sbi.o.
They are all caused by a kconfig problem with this warning:

WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE
Depends on [n]: CPU_IDLE [=y] && RISCV [=y] && RISCV_SBI [=n]
Selected by [y]:
- SOC_VIRT [=y] && CPU_IDLE [=y]

so make the 'select' of RISCV_SBI_CPUIDLE also depend on RISCV_SBI.

Fixes: c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine")
Signed-off-by: Randy Dunlap <[email protected]>
Reported-by: kernel test robot <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Paul Walmsley <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Albert Ou <[email protected]>
---
arch/riscv/Kconfig.socs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -38,7 +38,7 @@ config SOC_VIRT
select SIFIVE_PLIC
select PM_GENERIC_DOMAINS if PM
select PM_GENERIC_DOMAINS_OF if PM && OF
- select RISCV_SBI_CPUIDLE if CPU_IDLE
+ select RISCV_SBI_CPUIDLE if CPU_IDLE && RISCV_SBI
help
This enables support for QEMU Virt Machine.


2022-04-12 21:50:21

by Anup Patel

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: cpuidle: fix Kconfig select for RISCV_SBI_CPUIDLE

On Sun, Apr 10, 2022 at 4:23 AM Randy Dunlap <[email protected]> wrote:
>
> There can be lots of build errors when building cpuidle-riscv-sbi.o.
> They are all caused by a kconfig problem with this warning:
>
> WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE
> Depends on [n]: CPU_IDLE [=y] && RISCV [=y] && RISCV_SBI [=n]
> Selected by [y]:
> - SOC_VIRT [=y] && CPU_IDLE [=y]
>
> so make the 'select' of RISCV_SBI_CPUIDLE also depend on RISCV_SBI.
>
> Fixes: c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: Paul Walmsley <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: Albert Ou <[email protected]>

Looks good to me.

Reviewed-by: Anup Patel <[email protected]>

Regards,
Anup

> ---
> arch/riscv/Kconfig.socs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -38,7 +38,7 @@ config SOC_VIRT
> select SIFIVE_PLIC
> select PM_GENERIC_DOMAINS if PM
> select PM_GENERIC_DOMAINS_OF if PM && OF
> - select RISCV_SBI_CPUIDLE if CPU_IDLE
> + select RISCV_SBI_CPUIDLE if CPU_IDLE && RISCV_SBI
> help
> This enables support for QEMU Virt Machine.
>

2022-04-22 21:44:38

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH] RISC-V: cpuidle: fix Kconfig select for RISCV_SBI_CPUIDLE

On Sat, 09 Apr 2022 15:53:17 PDT (-0700), [email protected] wrote:
> There can be lots of build errors when building cpuidle-riscv-sbi.o.
> They are all caused by a kconfig problem with this warning:
>
> WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE
> Depends on [n]: CPU_IDLE [=y] && RISCV [=y] && RISCV_SBI [=n]
> Selected by [y]:
> - SOC_VIRT [=y] && CPU_IDLE [=y]
>
> so make the 'select' of RISCV_SBI_CPUIDLE also depend on RISCV_SBI.
>
> Fixes: c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Anup Patel <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: Paul Walmsley <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: Albert Ou <[email protected]>
> ---
> arch/riscv/Kconfig.socs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -38,7 +38,7 @@ config SOC_VIRT
> select SIFIVE_PLIC
> select PM_GENERIC_DOMAINS if PM
> select PM_GENERIC_DOMAINS_OF if PM && OF
> - select RISCV_SBI_CPUIDLE if CPU_IDLE
> + select RISCV_SBI_CPUIDLE if CPU_IDLE && RISCV_SBI
> help
> This enables support for QEMU Virt Machine.

Sorry to be slow here, I seem to remember having written this before but
I must have just gotted pulled into something else.

IMO the real bug here is that Kconfig.socs is poorly designed: I
misunderstood how select works at the time, we should really clean all
this up (or maybe just remove it entirely?) so we don't have to
duplicate all these dependencies.

That's a bigger project, though so this is on fixes -- it's way better
to have the build work.

Thanks!