linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK
@ 2020-11-15 17:09 Krzysztof Kozlowski
  2020-11-15 17:09 ` [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-15 17:09 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Michael Turquette,
	Stephen Boyd, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-arm-kernel, linux-kernel, linux-clk,
	linux-media, devel, alsa-devel
  Cc: Krzysztof Kozlowski

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(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-15 17:09 [PATCH 0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK Krzysztof Kozlowski
@ 2020-11-15 17:09 ` Krzysztof Kozlowski
  2020-11-18  7:41   ` Stephen Boyd
  2020-11-15 17:09 ` [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds Krzysztof Kozlowski
  2020-11-15 17:09 ` [RFC 3/3] media: atomisp: " Krzysztof Kozlowski
  2 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-15 17:09 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Michael Turquette,
	Stephen Boyd, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-arm-kernel, linux-kernel, linux-clk,
	linux-media, devel, alsa-devel
  Cc: Krzysztof Kozlowski

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
compile errors (MIPS architecture):

    drivers/clk/clk.c:855:6: error: redefinition of ‘clk_unprepare’
    In file included from drivers/clk/clk.c:9:
    include/linux/clk.h:263:20: note: previous definition of ‘clk_unprepare’ was here

The definitions clk_bulk_prepare() (and unprepare) already have proper
surrounding #ifdef so add them also for clk_prepare()/clk_unprepare().

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/clk/clk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index f83dac54ed85..f4f68c7c2fb5 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -841,6 +841,7 @@ static void clk_core_unprepare_lock(struct clk_core *core)
 	clk_prepare_unlock();
 }
 
+#ifdef CONFIG_HAVE_CLK_PREPARE
 /**
  * clk_unprepare - undo preparation of a clock source
  * @clk: the clk being unprepared
@@ -860,6 +861,7 @@ void clk_unprepare(struct clk *clk)
 	clk_core_unprepare_lock(clk->core);
 }
 EXPORT_SYMBOL_GPL(clk_unprepare);
+#endif
 
 static int clk_core_prepare(struct clk_core *core)
 {
@@ -921,6 +923,7 @@ static int clk_core_prepare_lock(struct clk_core *core)
 	return ret;
 }
 
+#ifdef CONFIG_HAVE_CLK_PREPARE
 /**
  * clk_prepare - prepare a clock source
  * @clk: the clk being prepared
@@ -941,6 +944,7 @@ int clk_prepare(struct clk *clk)
 	return clk_core_prepare_lock(clk->core);
 }
 EXPORT_SYMBOL_GPL(clk_prepare);
+#endif /* CONFIG_HAVE_CLK_PREPARE */
 
 static void clk_core_disable(struct clk_core *core)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds
  2020-11-15 17:09 [PATCH 0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK Krzysztof Kozlowski
  2020-11-15 17:09 ` [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Krzysztof Kozlowski
@ 2020-11-15 17:09 ` Krzysztof Kozlowski
  2020-11-17  4:36   ` Samuel Holland
  2020-11-15 17:09 ` [RFC 3/3] media: atomisp: " Krzysztof Kozlowski
  2 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-15 17:09 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Michael Turquette,
	Stephen Boyd, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-arm-kernel, linux-kernel, linux-clk,
	linux-media, devel, alsa-devel
  Cc: Krzysztof Kozlowski

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.  For example on MIPS a configuration with COMMON_CLK
(selected by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (selected by
SOC_RT305X) is possible:

  WARNING: unmet direct dependencies detected for COMMON_CLK
    Depends on [n]: !HAVE_LEGACY_CLK [=y]
    Selected by [y]:
    - SND_SUN8I_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
      (ARCH_SUNXI || COMPILE_TEST [=y]) && OF [=y] && (MACH_SUN8I || ARM64 && ARCH_SUNXI || COMPILE_TEST [=y])

    /usr/bin/mips-linux-gnu-ld: drivers/clk/clk.o: in function `clk_set_rate':
    (.text+0xaeb4): multiple definition of `clk_set_rate'; arch/mips/ralink/clk.o:(.text+0x88): first defined here

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/mach-sunxi/Kconfig | 1 +
 sound/soc/sunxi/Kconfig     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index eeadb1a4dcfe..4d9f9b6d329d 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -4,6 +4,7 @@ menuconfig ARCH_SUNXI
 	depends on ARCH_MULTI_V5 || ARCH_MULTI_V7
 	select ARCH_HAS_RESET_CONTROLLER
 	select CLKSRC_MMIO
+	select COMMON_CLK
 	select GENERIC_IRQ_CHIP
 	select GPIOLIB
 	select PINCTRL
diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
index 69b9d8515335..ddcaaa98d3cb 100644
--- a/sound/soc/sunxi/Kconfig
+++ b/sound/soc/sunxi/Kconfig
@@ -14,7 +14,7 @@ config SND_SUN8I_CODEC
 	tristate "Allwinner SUN8I audio codec"
 	depends on OF
 	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
-	select COMMON_CLK
+	depends on COMMON_CLK
 	select REGMAP_MMIO
 	help
 	  This option enables the digital part of the internal audio codec for
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [RFC 3/3] media: atomisp: do not select COMMON_CLK to fix builds
  2020-11-15 17:09 [PATCH 0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK Krzysztof Kozlowski
  2020-11-15 17:09 ` [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Krzysztof Kozlowski
  2020-11-15 17:09 ` [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds Krzysztof Kozlowski
@ 2020-11-15 17:09 ` Krzysztof Kozlowski
  2020-11-25  0:14   ` Stephen Boyd
  2 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-15 17:09 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Michael Turquette,
	Stephen Boyd, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-arm-kernel, linux-kernel, linux-clk,
	linux-media, devel, alsa-devel
  Cc: Krzysztof Kozlowski

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>
---
 drivers/staging/media/atomisp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
index 37577bb72998..742edb261d85 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -2,9 +2,9 @@
 menuconfig INTEL_ATOMISP
 	bool "Enable support to Intel Atom ISP camera drivers"
 	depends on X86 && EFI && PCI && ACPI
+	depends on COMMON_CLK
 	select IOSF_MBI
 	select MEDIA_CONTROLLER
-	select COMMON_CLK
 	help
 	  Enable support for the Intel ISP2 camera interfaces and MIPI
 	  sensor drivers.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds
  2020-11-15 17:09 ` [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds Krzysztof Kozlowski
@ 2020-11-17  4:36   ` Samuel Holland
  2020-11-17  7:37     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 12+ messages in thread
From: Samuel Holland @ 2020-11-17  4:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Michael Turquette, Stephen Boyd, Mauro Carvalho Chehab,
	Sakari Ailus, Greg Kroah-Hartman, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, linux-arm-kernel, linux-kernel,
	linux-clk, linux-media, devel, alsa-devel

On 11/15/20 11:09 AM, Krzysztof Kozlowski wrote:
> 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.  For example on MIPS a configuration with COMMON_CLK
> (selected by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (selected by
> SOC_RT305X) is possible:

Ah, that makes sense.

> 
>   WARNING: unmet direct dependencies detected for COMMON_CLK
>     Depends on [n]: !HAVE_LEGACY_CLK [=y]
>     Selected by [y]:
>     - SND_SUN8I_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
>       (ARCH_SUNXI || COMPILE_TEST [=y]) && OF [=y] && (MACH_SUN8I || ARM64 && ARCH_SUNXI || COMPILE_TEST [=y])
> 
>     /usr/bin/mips-linux-gnu-ld: drivers/clk/clk.o: in function `clk_set_rate':
>     (.text+0xaeb4): multiple definition of `clk_set_rate'; arch/mips/ralink/clk.o:(.text+0x88): first defined here
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  arch/arm/mach-sunxi/Kconfig | 1 +
>  sound/soc/sunxi/Kconfig     | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index eeadb1a4dcfe..4d9f9b6d329d 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -4,6 +4,7 @@ menuconfig ARCH_SUNXI
>  	depends on ARCH_MULTI_V5 || ARCH_MULTI_V7
>  	select ARCH_HAS_RESET_CONTROLLER
>  	select CLKSRC_MMIO
> +	select COMMON_CLK

This is not necessary, since ARCH_SUNXI depends (through ARCH_MULTI_V{5,7}) on
ARCH_MULTIPLATFORM, which selects COMMON_CLK already.

>  	select GENERIC_IRQ_CHIP
>  	select GPIOLIB
>  	select PINCTRL
> diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
> index 69b9d8515335..ddcaaa98d3cb 100644
> --- a/sound/soc/sunxi/Kconfig
> +++ b/sound/soc/sunxi/Kconfig
> @@ -14,7 +14,7 @@ config SND_SUN8I_CODEC
>  	tristate "Allwinner SUN8I audio codec"
>  	depends on OF
>  	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
> -	select COMMON_CLK
> +	depends on COMMON_CLK
>  	select REGMAP_MMIO
>  	help
>  	  This option enables the digital part of the internal audio codec for
> 

For this file:
Reviewed-by: Samuel Holland <samuel@sholland.org>

Thanks,
Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds
  2020-11-17  4:36   ` Samuel Holland
@ 2020-11-17  7:37     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-17  7:37 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Michael Turquette,
	Stephen Boyd, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-arm-kernel, linux-kernel, linux-clk,
	linux-media, devel, alsa-devel

On Mon, Nov 16, 2020 at 10:36:12PM -0600, Samuel Holland wrote:
> On 11/15/20 11:09 AM, Krzysztof Kozlowski wrote:
> > 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.  For example on MIPS a configuration with COMMON_CLK
> > (selected by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (selected by
> > SOC_RT305X) is possible:
> 
> Ah, that makes sense.
> 
> > 
> >   WARNING: unmet direct dependencies detected for COMMON_CLK
> >     Depends on [n]: !HAVE_LEGACY_CLK [=y]
> >     Selected by [y]:
> >     - SND_SUN8I_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
> >       (ARCH_SUNXI || COMPILE_TEST [=y]) && OF [=y] && (MACH_SUN8I || ARM64 && ARCH_SUNXI || COMPILE_TEST [=y])
> > 
> >     /usr/bin/mips-linux-gnu-ld: drivers/clk/clk.o: in function `clk_set_rate':
> >     (.text+0xaeb4): multiple definition of `clk_set_rate'; arch/mips/ralink/clk.o:(.text+0x88): first defined here
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  arch/arm/mach-sunxi/Kconfig | 1 +
> >  sound/soc/sunxi/Kconfig     | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> > index eeadb1a4dcfe..4d9f9b6d329d 100644
> > --- a/arch/arm/mach-sunxi/Kconfig
> > +++ b/arch/arm/mach-sunxi/Kconfig
> > @@ -4,6 +4,7 @@ menuconfig ARCH_SUNXI
> >  	depends on ARCH_MULTI_V5 || ARCH_MULTI_V7
> >  	select ARCH_HAS_RESET_CONTROLLER
> >  	select CLKSRC_MMIO
> > +	select COMMON_CLK
> 
> This is not necessary, since ARCH_SUNXI depends (through ARCH_MULTI_V{5,7}) on
> ARCH_MULTIPLATFORM, which selects COMMON_CLK already.

Thanks. I'll send a v2 with changes and your review.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-15 17:09 ` [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Krzysztof Kozlowski
@ 2020-11-18  7:41   ` Stephen Boyd
  2020-11-18  7:48     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2020-11-18  7:41 UTC (permalink / raw)
  To: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Krzysztof Kozlowski, Liam Girdwood, Mark Brown,
	Mauro Carvalho Chehab, Maxime Ripard, Michael Turquette,
	Sakari Ailus, Takashi Iwai, alsa-devel, devel, linux-arm-kernel,
	linux-clk, linux-kernel, linux-media
  Cc: Krzysztof Kozlowski

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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-18  7:41   ` Stephen Boyd
@ 2020-11-18  7:48     ` Krzysztof Kozlowski
  2020-11-25  0:11       ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-18  7:48 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Liam Girdwood, Mark Brown, Mauro Carvalho Chehab,
	Maxime Ripard, Michael Turquette, Sakari Ailus, Takashi Iwai,
	alsa-devel, devel, linux-arm-kernel, linux-clk, linux-kernel,
	linux-media

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-18  7:48     ` Krzysztof Kozlowski
@ 2020-11-25  0:11       ` Stephen Boyd
  2020-11-25 14:15         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2020-11-25  0:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Liam Girdwood, Mark Brown, Mauro Carvalho Chehab,
	Maxime Ripard, Michael Turquette, Sakari Ailus, Takashi Iwai,
	alsa-devel, devel, linux-arm-kernel, linux-clk, linux-kernel,
	linux-media

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC 3/3] media: atomisp: do not select COMMON_CLK to fix builds
  2020-11-15 17:09 ` [RFC 3/3] media: atomisp: " Krzysztof Kozlowski
@ 2020-11-25  0:14   ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-11-25  0:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Krzysztof Kozlowski, Liam Girdwood, Mark Brown,
	Mauro Carvalho Chehab, Maxime Ripard, Michael Turquette,
	Sakari Ailus, Takashi Iwai, alsa-devel, devel, linux-arm-kernel,
	linux-clk, linux-kernel, linux-media
  Cc: Krzysztof Kozlowski

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>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-25  0:11       ` Stephen Boyd
@ 2020-11-25 14:15         ` Krzysztof Kozlowski
  2020-11-27 20:19           ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-25 14:15 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Liam Girdwood, Mark Brown, Mauro Carvalho Chehab,
	Maxime Ripard, Michael Turquette, Sakari Ailus, Takashi Iwai,
	alsa-devel, devel, linux-arm-kernel, linux-clk, linux-kernel,
	linux-media

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK
  2020-11-25 14:15         ` Krzysztof Kozlowski
@ 2020-11-27 20:19           ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-11-27 20:19 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Chen-Yu Tsai, Greg Kroah-Hartman, Jaroslav Kysela,
	Jernej Skrabec, Liam Girdwood, Mark Brown, Mauro Carvalho Chehab,
	Maxime Ripard, Michael Turquette, Sakari Ailus, Takashi Iwai,
	alsa-devel, devel, linux-arm-kernel, linux-clk, linux-kernel,
	linux-media

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-27 20:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 17:09 [PATCH 0/3] clk/sunxi/media: Fix builds with COMMON_CLK and HAVE_LEGACY_CLK Krzysztof Kozlowski
2020-11-15 17:09 ` [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Krzysztof Kozlowski
2020-11-18  7:41   ` Stephen Boyd
2020-11-18  7:48     ` Krzysztof Kozlowski
2020-11-25  0:11       ` Stephen Boyd
2020-11-25 14:15         ` Krzysztof Kozlowski
2020-11-27 20:19           ` Stephen Boyd
2020-11-15 17:09 ` [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds Krzysztof Kozlowski
2020-11-17  4:36   ` Samuel Holland
2020-11-17  7:37     ` Krzysztof Kozlowski
2020-11-15 17:09 ` [RFC 3/3] media: atomisp: " Krzysztof Kozlowski
2020-11-25  0:14   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).