Re: [RESEND PATCH] clk: stm32: fix: stm32 clock drivers are not compiled by default

From: Stephen Boyd
Date: Fri May 04 2018 - 22:45:38 EST


Quoting Alexandre Torgue (2018-05-04 00:54:16)
> Stephen
>
> On 05/03/2018 08:40 AM, gabriel.fernandez@xxxxxx wrote:
> > From: Gabriel Fernandez <gabriel.fernandez@xxxxxx>
> >
> > Clock driver is mandatory if the machine is selected.
> > Then don't use 'bool' and 'depends on' commands, but 'def_bool'
> > with the machine(s).
> >
> > Fixes: da32d3539fca ("clk: stm32: add configuration flags for each of the stm32 drivers")
> >
>
> Sorry to insist but we need it to have STM32 MCUs booting on Kernel v4.17.

Thanks for the bump. I missed this one. Of course, the user can still select
the configs now, just it's annoying for upgrade path.

>
> > Signed-off-by: Gabriel Fernandez <gabriel.fernandez@xxxxxx>
> > Acked-by: Alexandre TORGUE <alexandre.torgue@xxxxxx>
> > ---
> > drivers/clk/Kconfig | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> > index 24a5bc3..721572a 100644
> > --- a/drivers/clk/Kconfig
> > +++ b/drivers/clk/Kconfig
> > @@ -266,15 +266,13 @@ config COMMON_CLK_STM32MP157
> > Support for stm32mp157 SoC family clocks
> >
> > config COMMON_CLK_STM32F
> > - bool "Clock driver for stm32f4 and stm32f7 SoC families"
> > - depends on MACH_STM32F429 || MACH_STM32F469 || MACH_STM32F746
> > + def_bool COMMON_CLK && (MACH_STM32F429 || MACH_STM32F469 || MACH_STM32F746)

But the point of the change this patch is fixing was to expose these to
the user to turn off they wanted. You'll need to do something like that
again here, instead of removing the prompt and replacing it with a
def_bool.

So this patch instead? It leaves it around for the whole arch, but
limits the default to be the machines that matter. I suppose we could
put an 'if EXPERT' on the bool part too if we don't even want to expose
the options to normal users.

-----8<-----
From: Gabriel Fernandez <gabriel.fernandez@xxxxxx>
Date: Thu, 3 May 2018 08:40:09 +0200
Subject: [PATCH] clk: stm32: fix: stm32 clock drivers are not compiled by
default
Cc: <linux-kernel@xxxxxxxxxxxxxxx>,
<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>

Clock driver is mandatory if the machine is selected. Add a default
of the machines that need the clk driver, so that the user can turn it
off if they want, but otherwise it's exposed on the SoCs the driver
is for.

Fixes: da32d3539fca ("clk: stm32: add configuration flags for each of the stm32 drivers")
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@xxxxxx>
Acked-by: Alexandre TORGUE <alexandre.torgue@xxxxxx>
Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
---
drivers/clk/Kconfig | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 41492e980ef4..ac3f0e2bc03f 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -267,15 +267,16 @@ config COMMON_CLK_STM32MP157

config COMMON_CLK_STM32F
bool "Clock driver for stm32f4 and stm32f7 SoC families"
- depends on MACH_STM32F429 || MACH_STM32F469 || MACH_STM32F746
+ depends on ARCH_STM32
+ default MACH_STM32F429 || MACH_STM32F469 || MACH_STM32F746
help
---help---
Support for stm32f4 and stm32f7 SoC families clocks

config COMMON_CLK_STM32H7
bool "Clock driver for stm32h7 SoC family"
- depends on MACH_STM32H743
- help
+ depends on ARCH_STM32
+ default MACH_STM32H743
---help---
Support for stm32h7 SoC family clocks

--
Sent by a computer through tubes