linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] soundwire: fix Kconfig select/depend issues
@ 2019-04-19 19:46 Pierre-Louis Bossart
  2019-04-19 19:46 ` [PATCH v2 1/2] soundwire: fix SOUNDWIRE_BUS option Pierre-Louis Bossart
  2019-04-19 19:46 ` [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue Pierre-Louis Bossart
  0 siblings, 2 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-04-19 19:46 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-kernel, tiwai, broonie, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Pierre-Louis Bossart

0-day/Kbuild starts complaining about missed module dependencies and
compilation issues. Since codecs and soc drivers need to be compilable
independently, let's fix this using the following model:

SOF_INTEL_XYZ --- select ---->  SOUNDWIRE_INTEL ---> select ----
                                                               |
				                               v
                                                        SOUNDWIRE_BUS
   							       ^
                                                               |
CODEC_ABC ------- select -----> REGMAP_SOUNDWIRE ---> select ---

The SOUNDWIRE option remains a top-level boolean selector without
impact on compilation, as recommended by Linus [1] and done for all
Intel ASoC stuff.

[1] https://lkml.org/lkml/2017/11/15/554

Changes since v1:
Removed useless depend in REGMAP_SOUNDWIRE (select will ignore dependencies)
Reordered patches to avoid circular dependencies with git bisect

Pierre-Louis Bossart (2):
  soundwire: fix SOUNDWIRE_BUS option
  regmap: soundwire: fix Kconfig select/depend issue

 drivers/base/regmap/Kconfig | 2 +-
 drivers/soundwire/Kconfig   | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

-- 
2.17.1


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

* [PATCH v2 1/2] soundwire: fix SOUNDWIRE_BUS option
  2019-04-19 19:46 [PATCH v2 0/2] soundwire: fix Kconfig select/depend issues Pierre-Louis Bossart
@ 2019-04-19 19:46 ` Pierre-Louis Bossart
  2019-04-19 19:46 ` [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue Pierre-Louis Bossart
  1 sibling, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-04-19 19:46 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-kernel, tiwai, broonie, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Pierre-Louis Bossart,
	Sanyog Kale

The existing Kconfig can lead to the following warning:

WARNING: unmet direct dependencies detected for REGMAP_SOUNDWIRE
  Depends on [m]: SOUNDWIRE_BUS [=m]
  Selected by [y]:
  - SND_SOC_RT700_SDW [=y] && SOUND [=y] && !UML && SND [=y] &&
    SND_SOC [=y] && SOUNDWIRE [=y]
  Selected by [m]:
  - SOUNDWIRE_BUS [=m] && SOUNDWIRE [=y]

Remove wrong-way link between SOUNDWIRE_BUS and REGMAP_SOUNDWIRE

SOUNDWIRE_BUS can be selected independendly by the SOC driver
(e.g. SOUNDWIRE_INTEL) or the codec driver (via REGMAP_SOUNDWIRE).

Fixes: 6c49b32d3c09 ('soundwire: select REGMAP_SOUNDWIRE')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/soundwire/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/soundwire/Kconfig b/drivers/soundwire/Kconfig
index 84876a74874f..d382d80d2fe1 100644
--- a/drivers/soundwire/Kconfig
+++ b/drivers/soundwire/Kconfig
@@ -18,7 +18,6 @@ comment "SoundWire Devices"
 
 config SOUNDWIRE_BUS
 	tristate
-	select REGMAP_SOUNDWIRE
 
 config SOUNDWIRE_CADENCE
 	tristate
-- 
2.17.1


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

* [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-04-19 19:46 [PATCH v2 0/2] soundwire: fix Kconfig select/depend issues Pierre-Louis Bossart
  2019-04-19 19:46 ` [PATCH v2 1/2] soundwire: fix SOUNDWIRE_BUS option Pierre-Louis Bossart
@ 2019-04-19 19:46 ` Pierre-Louis Bossart
  2019-04-22  6:01   ` Vinod Koul
  2019-05-03  4:39   ` Mark Brown
  1 sibling, 2 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-04-19 19:46 UTC (permalink / raw)
  To: alsa-devel
  Cc: linux-kernel, tiwai, broonie, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Pierre-Louis Bossart,
	Rafael J. Wysocki

The mechanism should be

config CODEC_XYX_SDW
       depends on SOUNDWIRE
       select REGMAP_SOUNDWIRE

config REGMAP_SOUNDWIRE
       select SOUNDWIRE_BUS

SOUNDWIRE_BUS can be independently selected by the SOC driver. The SOC
driver should not know or care about REGMAP_SOUNDWIRE.

Fixes: 7c22ce6e2184 ('03fc8746f7915b5a391d8227f7e1')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/base/regmap/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index 6ad5ef48b61e..c12e3f1fb110 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -44,7 +44,7 @@ config REGMAP_IRQ
 
 config REGMAP_SOUNDWIRE
 	tristate
-	depends on SOUNDWIRE_BUS
+	select SOUNDWIRE_BUS
 
 config REGMAP_SCCB
 	tristate
-- 
2.17.1


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

* Re: [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-04-19 19:46 ` [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue Pierre-Louis Bossart
@ 2019-04-22  6:01   ` Vinod Koul
  2019-05-03  4:39   ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2019-04-22  6:01 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, linux-kernel, tiwai, broonie, gregkh,
	liam.r.girdwood, jank, joe, srinivas.kandagatla,
	Rafael J. Wysocki

On 19-04-19, 14:46, Pierre-Louis Bossart wrote:
> The mechanism should be
> 
> config CODEC_XYX_SDW
>        depends on SOUNDWIRE
>        select REGMAP_SOUNDWIRE
> 
> config REGMAP_SOUNDWIRE
>        select SOUNDWIRE_BUS
> 
> SOUNDWIRE_BUS can be independently selected by the SOC driver. The SOC
> driver should not know or care about REGMAP_SOUNDWIRE.

lgtm, Mark can I have ypu ack so that I can carry the series thru
soundwire tree

Thanks

> Fixes: 7c22ce6e2184 ('03fc8746f7915b5a391d8227f7e1')
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  drivers/base/regmap/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
> index 6ad5ef48b61e..c12e3f1fb110 100644
> --- a/drivers/base/regmap/Kconfig
> +++ b/drivers/base/regmap/Kconfig
> @@ -44,7 +44,7 @@ config REGMAP_IRQ
>  
>  config REGMAP_SOUNDWIRE
>  	tristate
> -	depends on SOUNDWIRE_BUS
> +	select SOUNDWIRE_BUS
>  
>  config REGMAP_SCCB
>  	tristate
> -- 
> 2.17.1

-- 
~Vinod

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

* Re: [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-04-19 19:46 ` [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue Pierre-Louis Bossart
  2019-04-22  6:01   ` Vinod Koul
@ 2019-05-03  4:39   ` Mark Brown
  2019-05-03 14:32     ` Pierre-Louis Bossart
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2019-05-03  4:39 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, linux-kernel, tiwai, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Rafael J. Wysocki

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

On Fri, Apr 19, 2019 at 02:46:49PM -0500, Pierre-Louis Bossart wrote:

>  config REGMAP_SOUNDWIRE
>  	tristate
> -	depends on SOUNDWIRE_BUS
> +	select SOUNDWIRE_BUS

This now makes _SOUNDWIRE different to all the other bus types; if this
is a good change then surely the same thing should be done for all the
other bus types.  It's also not clear to me that this actually does
anything, do selects from symbols that are themselves selected actually
do anything?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-05-03  4:39   ` Mark Brown
@ 2019-05-03 14:32     ` Pierre-Louis Bossart
  2019-05-06  4:40       ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-03 14:32 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linux-kernel, tiwai, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Rafael J. Wysocki



On 5/2/19 11:39 PM, Mark Brown wrote:
> On Fri, Apr 19, 2019 at 02:46:49PM -0500, Pierre-Louis Bossart wrote:
> 
>>   config REGMAP_SOUNDWIRE
>>   	tristate
>> -	depends on SOUNDWIRE_BUS
>> +	select SOUNDWIRE_BUS
> 
> This now makes _SOUNDWIRE different to all the other bus types; if this
> is a good change then surely the same thing should be done for all the
> other bus types.  It's also not clear to me that this actually does
> anything, do selects from symbols that are themselves selected actually
> do anything?

yes, this works, but if you prefer alignment I can follow the SLIMBUS model

config SND_SOC_WCD9335
	tristate "WCD9335 Codec"
	depends on SLIMBUS
	select REGMAP_SLIMBUS
	select REGMAP_IRQ

config REGMAP_SLIMBUS
	tristate
	depends on SLIMBUS

menuconfig SLIMBUS
	tristate "SLIMbus support"
	
if SLIMBUS

# SLIMbus controllers
config SLIM_QCOM_CTRL
...

As I mentioned it'll compile the bus even if there is no user for it, 
but it's your call: alignment or optimization.

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

* Re: [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-05-03 14:32     ` Pierre-Louis Bossart
@ 2019-05-06  4:40       ` Mark Brown
  2019-05-06 15:28         ` Pierre-Louis Bossart
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2019-05-06  4:40 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, linux-kernel, tiwai, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Rafael J. Wysocki

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

On Fri, May 03, 2019 at 09:32:53AM -0500, Pierre-Louis Bossart wrote:

> As I mentioned it'll compile the bus even if there is no user for it, but
> it's your call: alignment or optimization.

You can have both.  Alignment is a requirement.  If you want to optimize
this then it'd be better to optimize all the bus types rather than just
having the one weird bus type that does something different for no
documented reason.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue
  2019-05-06  4:40       ` Mark Brown
@ 2019-05-06 15:28         ` Pierre-Louis Bossart
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-06 15:28 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, linux-kernel, tiwai, vkoul, gregkh, liam.r.girdwood,
	jank, joe, srinivas.kandagatla, Rafael J. Wysocki

On 5/5/19 11:40 PM, Mark Brown wrote:
> On Fri, May 03, 2019 at 09:32:53AM -0500, Pierre-Louis Bossart wrote:
> 
>> As I mentioned it'll compile the bus even if there is no user for it, but
>> it's your call: alignment or optimization.
> 
> You can have both.  Alignment is a requirement.  If you want to optimize
> this then it'd be better to optimize all the bus types rather than just
> having the one weird bus type that does something different for no
> documented reason.

Fine, I'll align if this is the requirement.
Thanks for the feedback.

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

end of thread, other threads:[~2019-05-06 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19 19:46 [PATCH v2 0/2] soundwire: fix Kconfig select/depend issues Pierre-Louis Bossart
2019-04-19 19:46 ` [PATCH v2 1/2] soundwire: fix SOUNDWIRE_BUS option Pierre-Louis Bossart
2019-04-19 19:46 ` [PATCH v2 2/2] regmap: soundwire: fix Kconfig select/depend issue Pierre-Louis Bossart
2019-04-22  6:01   ` Vinod Koul
2019-05-03  4:39   ` Mark Brown
2019-05-03 14:32     ` Pierre-Louis Bossart
2019-05-06  4:40       ` Mark Brown
2019-05-06 15:28         ` Pierre-Louis Bossart

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