mbox series

[0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK

Message ID 20201115170950.304460-1-krzk@kernel.org
Headers show
Series clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK | expand

Message

Krzysztof Kozlowski Nov. 15, 2020, 5:09 p.m. UTC
Hi,

Multiple configurations create unbuildable config by selecting
COMMON_CLK and HAVE_LEGACY_CLK.  The first simply should not be
selected.

The patches 2/3 and 3/3 address this specific problem.  I performed few
compile tests and I am still building other configurations, therefore
they were marked as RFC.

Best regards,
Krzysztof


Krzysztof Kozlowski (3):
  clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  ARM: sunxi: do not select COMMON_CLK to fix builds
  media: atomisp: do not select COMMON_CLK to fix builds

 arch/arm/mach-sunxi/Kconfig           | 1 +
 drivers/clk/clk.c                     | 4 ++++
 drivers/staging/media/atomisp/Kconfig | 2 +-
 sound/soc/sunxi/Kconfig               | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

Comments

Stephen Boyd Nov. 18, 2020, 7:41 a.m. UTC | #1
Quoting Krzysztof Kozlowski (2020-11-15 09:09:48)
> COMMON_CLK even though is a user-selectable symbol, is still selected by

> multiple other config options.  COMMON_CLK should not be used when

> legacy clocks are provided by architecture, so it correctly depends on

> !HAVE_LEGACY_CLK.

> 

> However it is possible to create a config which selects both COMMON_CLK

> (by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (by SOC_RT305X) which leads to


Why is SND_SUN8I_CODEC selecting COMMON_CLK? Or really, why is
SOC_RT305X selecting HAVE_LEGACY_CLK?
Krzysztof Kozlowski Nov. 18, 2020, 7:48 a.m. UTC | #2
On Tue, Nov 17, 2020 at 11:41:57PM -0800, Stephen Boyd wrote:
> Quoting Krzysztof Kozlowski (2020-11-15 09:09:48)

> > COMMON_CLK even though is a user-selectable symbol, is still selected by

> > multiple other config options.  COMMON_CLK should not be used when

> > legacy clocks are provided by architecture, so it correctly depends on

> > !HAVE_LEGACY_CLK.

> > 

> > However it is possible to create a config which selects both COMMON_CLK

> > (by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (by SOC_RT305X) which leads to

> 

> Why is SND_SUN8I_CODEC selecting COMMON_CLK? Or really, why is

> SOC_RT305X selecting HAVE_LEGACY_CLK?


The SND_SUN8I_CODEC I fixed in following patch (I sent separately v2 of
it).

The SOC_RT305X select HAVE_LEGACY_CLK? because it is an old, Ralink
platform, not converted to Common clock frm. Few clock operations are
defined in: arch/mips/ralink/clk.c

Best regards,
Krzysztof
Stephen Boyd Nov. 25, 2020, 12:11 a.m. UTC | #3
Quoting Krzysztof Kozlowski (2020-11-17 23:48:12)
> On Tue, Nov 17, 2020 at 11:41:57PM -0800, Stephen Boyd wrote:

> > Quoting Krzysztof Kozlowski (2020-11-15 09:09:48)

> > > COMMON_CLK even though is a user-selectable symbol, is still selected by

> > > multiple other config options.  COMMON_CLK should not be used when

> > > legacy clocks are provided by architecture, so it correctly depends on

> > > !HAVE_LEGACY_CLK.

> > > 

> > > However it is possible to create a config which selects both COMMON_CLK

> > > (by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (by SOC_RT305X) which leads to

> > 

> > Why is SND_SUN8I_CODEC selecting COMMON_CLK? Or really, why is

> > SOC_RT305X selecting HAVE_LEGACY_CLK?

> 

> The SND_SUN8I_CODEC I fixed in following patch (I sent separately v2 of

> it).

> 

> The SOC_RT305X select HAVE_LEGACY_CLK? because it is an old, Ralink

> platform, not converted to Common clock frm. Few clock operations are

> defined in: arch/mips/ralink/clk.c

> 


Ok so this patch isn't necessary then? It seems OK to select
HAVE_LEGACY_CLK but not to select COMMON_CLK unless it's architecture
code that can't be enabled when the other architecture code is selecting
HAVE_LEGACY_CLK.
Stephen Boyd Nov. 25, 2020, 12:14 a.m. UTC | #4
Quoting Krzysztof Kozlowski (2020-11-15 09:09:50)
> COMMON_CLK is a user-selectable option with its own dependencies.  The

> most important dependency is !HAVE_LEGACY_CLK.  User-selectable drivers

> should not select COMMON_CLK because they will create a dependency cycle

> and build failures.

> 

> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>


This is fallout from making the COMMON_CLK symbol selectable in commit
bbd7ffdbef68 ("clk: Allow the common clk framework to be selectable").
Before then we needed drivers to select the COMMON_CLK config so that
the framework was enabled. Now that isn't necessary and any
user-selectable options should be moved to depends syntax.

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Krzysztof Kozlowski Nov. 25, 2020, 2:15 p.m. UTC | #5
On Tue, Nov 24, 2020 at 04:11:31PM -0800, Stephen Boyd wrote:
> Quoting Krzysztof Kozlowski (2020-11-17 23:48:12)

> > On Tue, Nov 17, 2020 at 11:41:57PM -0800, Stephen Boyd wrote:

> > > Quoting Krzysztof Kozlowski (2020-11-15 09:09:48)

> > > > COMMON_CLK even though is a user-selectable symbol, is still selected by

> > > > multiple other config options.  COMMON_CLK should not be used when

> > > > legacy clocks are provided by architecture, so it correctly depends on

> > > > !HAVE_LEGACY_CLK.

> > > > 

> > > > However it is possible to create a config which selects both COMMON_CLK

> > > > (by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (by SOC_RT305X) which leads to

> > > 

> > > Why is SND_SUN8I_CODEC selecting COMMON_CLK? Or really, why is

> > > SOC_RT305X selecting HAVE_LEGACY_CLK?

> > 

> > The SND_SUN8I_CODEC I fixed in following patch (I sent separately v2 of

> > it).

> > 

> > The SOC_RT305X select HAVE_LEGACY_CLK? because it is an old, Ralink

> > platform, not converted to Common clock frm. Few clock operations are

> > defined in: arch/mips/ralink/clk.c

> > 

> 

> Ok so this patch isn't necessary then?


For this particular build failure - it is not necessary anymore.

However there might more of such errors - just not discovered yet. Also,
the clock bulk API has such ifdefs so it kind of symmetrical and
consistent approach.

> It seems OK to select

> HAVE_LEGACY_CLK but not to select COMMON_CLK unless it's architecture

> code that can't be enabled when the other architecture code is selecting

> HAVE_LEGACY_CLK.


Best regards,
Krzysztof
Stephen Boyd Nov. 27, 2020, 8:19 p.m. UTC | #6
Quoting Krzysztof Kozlowski (2020-11-25 06:15:05)
> On Tue, Nov 24, 2020 at 04:11:31PM -0800, Stephen Boyd wrote:

> > 

> > Ok so this patch isn't necessary then?

> 

> For this particular build failure - it is not necessary anymore.

> 

> However there might more of such errors - just not discovered yet. Also,

> the clock bulk API has such ifdefs so it kind of symmetrical and

> consistent approach.

> 


Ok. Patches always welcome.