linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
@ 2012-11-22 12:31 Lothar Waßmann
  2012-11-22 12:31 ` [PATCH] ASoC: imx: add MODULE_LICENSE("GPL") Lothar Waßmann
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-22 12:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: Shawn Guo, linux-kernel, Mark Brown, Lothar Waßmann

Due to a broken make rule, imx-pcm-dma.c or imx-pcm-fiq.c (whatever is
selected via Kconfig) will not be compiled when building as module,
resulting in a non-functional sound driver.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/Makefile |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile
index 515ba66..7bb5c38 100644
--- a/sound/soc/fsl/Makefile
+++ b/sound/soc/fsl/Makefile
@@ -36,8 +36,12 @@ obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o
 
 obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o
 snd-soc-imx-pcm-y := imx-pcm.o
-snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += imx-pcm-fiq.o
-snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_DMA) += imx-pcm-dma.o
+ifneq ($(CONFIG_SND_SOC_IMX_PCM_FIQ),)
+	snd-soc-imx-pcm-objs += imx-pcm-fiq.o
+endif
+ifneq ($(CONFIG_SND_SOC_IMX_PCM_DMA),)
+	snd-soc-imx-pcm-objs += imx-pcm-dma.o
+endif
 
 # i.MX Machine Support
 snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o
-- 
1.7.2.5


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

* [PATCH] ASoC: imx: add MODULE_LICENSE("GPL")
  2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
@ 2012-11-22 12:31 ` Lothar Waßmann
  2012-11-23 14:40   ` Mark Brown
  2012-11-22 12:31 ` [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use Lothar Waßmann
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-22 12:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: Shawn Guo, linux-kernel, Mark Brown, Lothar Waßmann

also set MODULE_AUTHOR and MODULE_DESCRIPTION

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/imx-pcm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/imx-pcm.c b/sound/soc/fsl/imx-pcm.c
index 93dc360..d5cd9ef 100644
--- a/sound/soc/fsl/imx-pcm.c
+++ b/sound/soc/fsl/imx-pcm.c
@@ -103,3 +103,7 @@ void imx_pcm_free(struct snd_pcm *pcm)
 	}
 }
 EXPORT_SYMBOL_GPL(imx_pcm_free);
+
+MODULE_DESCRIPTION("Freescale i.MX PCM driver");
+MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
+MODULE_LICENSE("GPL");
-- 
1.7.2.5


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

* [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use
  2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
  2012-11-22 12:31 ` [PATCH] ASoC: imx: add MODULE_LICENSE("GPL") Lothar Waßmann
@ 2012-11-22 12:31 ` Lothar Waßmann
  2012-11-23 14:42   ` Mark Brown
  2012-11-22 12:31 ` [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk Lothar Waßmann
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-22 12:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: Shawn Guo, linux-kernel, Mark Brown, Lothar Waßmann

set the 'onwer' field of the registered snd_soc_card object to prevent
removal of the module when its resources are in use.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/imx-sgtl5000.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 199408e..3d9b1c4 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -162,6 +162,7 @@ static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
 	if (ret)
 		goto clk_fail;
 	data->card.num_links = 1;
+	data->card.owner = THIS_MODULE;
 	data->card.dai_link = &data->dai;
 	data->card.dapm_widgets = imx_sgtl5000_dapm_widgets;
 	data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets);
-- 
1.7.2.5


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

* [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk
  2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
  2012-11-22 12:31 ` [PATCH] ASoC: imx: add MODULE_LICENSE("GPL") Lothar Waßmann
  2012-11-22 12:31 ` [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use Lothar Waßmann
@ 2012-11-22 12:31 ` Lothar Waßmann
  2012-11-23  2:06   ` Mark Brown
  2012-11-22 12:31 ` [PATCH] ASoC: dmaengine_pcm: set MODULE_LICENSE Lothar Waßmann
  2012-11-23  2:05 ` [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Mark Brown
  4 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-22 12:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: Shawn Guo, linux-kernel, Mark Brown, Lothar Waßmann


Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/mxs/mxs-saif.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index c294fbb..f1d1f9e 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -229,6 +229,7 @@ int mxs_saif_put_mclk(unsigned int saif_id)
 	saif->mclk_in_use = 0;
 	return 0;
 }
+EXPORT_SYMBOL_GPL(mxs_saif_put_mclk);
 
 /*
  * Get MCLK and set clock rate, then enable it
@@ -282,6 +283,7 @@ int mxs_saif_get_mclk(unsigned int saif_id, unsigned int mclk,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(mxs_saif_get_mclk);
 
 /*
  * SAIF DAI format configuration.
-- 
1.7.2.5


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

* [PATCH] ASoC: dmaengine_pcm: set MODULE_LICENSE
  2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
                   ` (2 preceding siblings ...)
  2012-11-22 12:31 ` [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk Lothar Waßmann
@ 2012-11-22 12:31 ` Lothar Waßmann
  2012-11-23  2:05 ` [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Mark Brown
  4 siblings, 0 replies; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-22 12:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: Shawn Guo, linux-kernel, Mark Brown, Lothar Waßmann


Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/soc-dmaengine-pcm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c
index bbc1257..111b7d92 100644
--- a/sound/soc/soc-dmaengine-pcm.c
+++ b/sound/soc/soc-dmaengine-pcm.c
@@ -317,3 +317,5 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_close);
+
+MODULE_LICENSE("GPL");
-- 
1.7.2.5


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

* Re: [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
                   ` (3 preceding siblings ...)
  2012-11-22 12:31 ` [PATCH] ASoC: dmaengine_pcm: set MODULE_LICENSE Lothar Waßmann
@ 2012-11-23  2:05 ` Mark Brown
  2012-11-23  6:59   ` Lothar Waßmann
  4 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23  2:05 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Thu, Nov 22, 2012 at 01:31:06PM +0100, Lothar Waßmann wrote:

>  obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o
>  snd-soc-imx-pcm-y := imx-pcm.o
> -snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += imx-pcm-fiq.o
> -snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_DMA) += imx-pcm-dma.o
> +ifneq ($(CONFIG_SND_SOC_IMX_PCM_FIQ),)
> +	snd-soc-imx-pcm-objs += imx-pcm-fiq.o
> +endif
> +ifneq ($(CONFIG_SND_SOC_IMX_PCM_DMA),)
> +	snd-soc-imx-pcm-objs += imx-pcm-dma.o
> +endif

What is the actual bug here?  This fix doesn't look obviously right, and
if we do need to move to -objs for some reason then the block ought to
be in the -objs section of the Makefile.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk
  2012-11-22 12:31 ` [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk Lothar Waßmann
@ 2012-11-23  2:06   ` Mark Brown
  2012-11-23  7:21     ` Lothar Waßmann
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23  2:06 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Thu, Nov 22, 2012 at 01:31:09PM +0100, Lothar Waßmann wrote:
> 
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>

Why?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  2:05 ` [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Mark Brown
@ 2012-11-23  6:59   ` Lothar Waßmann
  2012-11-23  8:13     ` Mark Brown
  0 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-23  6:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel

Hi,

Mark Brown writes:
> On Thu, Nov 22, 2012 at 01:31:06PM +0100, Lothar Waßmann wrote:
> 
> >  obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o
> >  snd-soc-imx-pcm-y := imx-pcm.o
> > -snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += imx-pcm-fiq.o
> > -snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_DMA) += imx-pcm-dma.o
> > +ifneq ($(CONFIG_SND_SOC_IMX_PCM_FIQ),)
> > +	snd-soc-imx-pcm-objs += imx-pcm-fiq.o
> > +endif
> > +ifneq ($(CONFIG_SND_SOC_IMX_PCM_DMA),)
> > +	snd-soc-imx-pcm-objs += imx-pcm-dma.o
> > +endif
> 
> What is the actual bug here?  This fix doesn't look obviously right, and
> if we do need to move to -objs for some reason then the block ought to
> be in the -objs section of the Makefile.
>
As I mentioned in the part of my email that you didn't quote, if the
sound driver is being compiled as module, the files imx-pcm-fiq.c or
imx-pcm-dma.c which should be compiled as part of imx-pcm.o will not
be touched by the compiler:
CONFIG_SND_SOC_IMX_PCM=m
CONFIG_SND_SOC_IMX_PCM_DMA=m
CONFIG_SND_SOC_IMX_AUDMUX=m
CONFIG_SND_SOC_IMX_SGTL5000=m
  GEN     /usr/local/src/arm/projects/imx53/Release/rel-next/.build-snd-bugfix/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
  GEN     /projects/imx53/Release/rel-next/.build-snd-bugfix/Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /usr/local/src/arm/projects/imx53/Release/rel-next/linux-next as source for kernel
  CHK     include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
  CALL    /usr/local/src/arm/projects/imx53/Release/rel-next/linux-next/scripts/checksyscalls.sh
  LD      sound/core/built-in.o
  CC [M]  sound/core/compress_offload.o
  LD      sound/soc/built-in.o
  CC [M]  sound/soc/soc-core.o
  CC [M]  sound/soc/soc-dapm.o
  CC [M]  sound/soc/soc-jack.o
  CC [M]  sound/core/memalloc.o
  CC [M]  sound/core/pcm.o
  CC [M]  sound/soc/soc-cache.o
  CC [M]  sound/core/pcm_native.o
  CC [M]  sound/core/pcm_lib.o
  CC [M]  sound/soc/soc-utils.o
  CC [M]  sound/core/pcm_timer.o
  CC [M]  sound/soc/soc-pcm.o
  CC [M]  sound/soc/soc-compress.o
  CC [M]  sound/soc/soc-io.o
  CC [M]  sound/soc/soc-dmaengine-pcm.o
  CC [M]  sound/core/pcm_misc.o
  CC [M]  sound/core/pcm_memory.o
  CC [M]  sound/core/timer.o
  LD      sound/soc/codecs/built-in.o
  CC [M]  sound/soc/codecs/sgtl5000.o
  LD      sound/soc/fsl/built-in.o
  CC [M]  sound/soc/fsl/fsl_ssi.o
  CC [M]  sound/soc/fsl/fsl_utils.o
  CC [M]  sound/soc/fsl/imx-audmux.o
  LD [M]  sound/soc/codecs/snd-soc-sgtl5000.o
  CC [M]  sound/soc/fsl/imx-pcm.o
  CC [M]  sound/soc/fsl/imx-sgtl5000.o
  LD [M]  sound/soc/snd-soc-core.o
  LD [M]  sound/core/snd-timer.o
  LD [M]  sound/core/snd-hrtimer.o
  LD [M]  sound/core/snd-pcm.o
  LD [M]  sound/core/snd-page-alloc.o
  LD [M]  sound/core/snd-compress.o
  LD [M]  sound/soc/fsl/snd-soc-fsl-ssi.o
  LD [M]  sound/soc/fsl/snd-soc-fsl-utils.o
  LD [M]  sound/soc/fsl/snd-soc-imx-audmux.o
  LD [M]  sound/soc/fsl/snd-soc-imx-pcm.o
  LD [M]  sound/soc/fsl/snd-soc-imx-sgtl5000.o
  LD      sound/built-in.o


With the following config:
CONFIG_SND_SOC_IMX_PCM=y
CONFIG_SND_SOC_IMX_PCM_DMA=y
CONFIG_SND_SOC_IMX_AUDMUX=y
CONFIG_SND_SOC_IMX_SGTL5000=y
  GEN     /usr/local/src/arm/projects/imx53/Release/rel-next/.build-snd-bugfix/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
  GEN     /usr/local/src/arm/projects/imx53/Release/rel-next/.build-snd-bugfix/Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /usr/local/src/arm/projects/imx53/Release/rel-next/linux-next as source for kernel
  CHK     include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
  CALL    /usr/local/src/arm/projects/imx53/Release/rel-next/linux-next/scripts/checksyscalls.sh
  CC      sound/soc/soc-core.o
  CC      sound/soc/soc-dapm.o
  CC      sound/soc/soc-jack.o
  CC      sound/soc/soc-cache.o
  CC      sound/soc/soc-utils.o
  CC      sound/soc/soc-pcm.o
  CC      sound/soc/soc-compress.o
  CC      sound/soc/soc-io.o
  CC      sound/soc/soc-dmaengine-pcm.o
  LD      sound/soc/atmel/built-in.o
  LD      sound/soc/au1x/built-in.o
  LD      sound/soc/blackfin/built-in.o
  LD      sound/soc/cirrus/built-in.o
  CC      sound/soc/codecs/sgtl5000.o
  LD      sound/soc/davinci/built-in.o
  LD      sound/soc/dwc/built-in.o
  CC      sound/soc/fsl/fsl_ssi.o
  LD      sound/soc/generic/built-in.o
  LD      sound/soc/jz4740/built-in.o
  LD      sound/soc/kirkwood/built-in.o
  LD      sound/soc/mid-x86/built-in.o
  LD      sound/soc/mxs/built-in.o
  LD      sound/soc/nuc900/built-in.o
  LD      sound/soc/omap/built-in.o
  CC      sound/soc/fsl/fsl_utils.o
  LD      sound/soc/pxa/built-in.o
  LD      sound/soc/s6000/built-in.o
  LD      sound/soc/samsung/built-in.o
  LD      sound/soc/sh/built-in.o
  LD      sound/soc/tegra/built-in.o
  CC      sound/soc/fsl/imx-audmux.o
  LD      sound/soc/txx9/built-in.o
  CC      sound/soc/fsl/imx-pcm.o
  LD      sound/soc/ux500/built-in.o
  CC      sound/soc/fsl/imx-pcm-dma.o
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  LD      sound/soc/codecs/snd-soc-sgtl5000.o
  LD      sound/soc/codecs/built-in.o
  CC      sound/soc/fsl/imx-sgtl5000.o
  LD      sound/soc/snd-soc-core.o
  LD      sound/soc/fsl/snd-soc-fsl-ssi.o
  LD      sound/soc/fsl/snd-soc-fsl-utils.o
  LD      sound/soc/fsl/snd-soc-imx-audmux.o
  LD      sound/soc/fsl/snd-soc-imx-pcm.o
  LD      sound/soc/fsl/snd-soc-imx-sgtl5000.o
  LD      sound/soc/fsl/built-in.o
  LD      sound/soc/built-in.o


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

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

* Re: [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk
  2012-11-23  2:06   ` Mark Brown
@ 2012-11-23  7:21     ` Lothar Waßmann
  2012-11-23 14:45       ` Mark Brown
  0 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-23  7:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel

Hi,

> On Thu, Nov 22, 2012 at 01:31:09PM +0100, Lothar Waßmann wrote:
> > 
> > Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
> 
> Why?
>
I thought that was obvious... To be able to compile the mxs sound
driver as module.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

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

* Re: [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  6:59   ` Lothar Waßmann
@ 2012-11-23  8:13     ` Mark Brown
  2012-11-23  9:12       ` [PATCH v2] " Lothar Waßmann
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23  8:13 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 07:59:56AM +0100, Lothar Waßmann wrote:
> Mark Brown writes:

> > What is the actual bug here?  This fix doesn't look obviously right, and
> > if we do need to move to -objs for some reason then the block ought to
> > be in the -objs section of the Makefile.

> As I mentioned in the part of my email that you didn't quote, if the
> sound driver is being compiled as module, the files imx-pcm-fiq.c or
> imx-pcm-dma.c which should be compiled as part of imx-pcm.o will not
> be touched by the compiler:

That's more detailed than your previous mail but you're still only
describing the symptom, not the what the actual error is or how it's
fixed...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  8:13     ` Mark Brown
@ 2012-11-23  9:12       ` Lothar Waßmann
  2012-11-23 10:08         ` Mark Brown
                           ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-23  9:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel, Lothar Waßmann

Due to a broken make rule, sound/soc/fsl/imx-pcm-dma.c or
sound/soc/fsl/imx-pcm-fiq.c (whatever is selected via Kconfig) will
not be compiled into imx-pcm.o when building as module, i.e.:
CONFIG_SND_SOC_IMX_PCM=m
CONFIG_SND_SOC_IMX_PCM_DMA=m
resulting in a non-functional sound driver.

This gives the error messages:
| imx-sgtl5000 sound.1: platform imx-pcm-audio not registered
| imx-sgtl5000 sound.1: snd_soc_register_card failed (-517)
| platform sound.1: Driver imx-sgtl5000 requests probe deferral
when loading the driver instead of what's to be expected:
| imx-sgtl5000 sound.1:  sgtl5000 <-> 63fcc000.ssi mapping ok

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile
index 515ba66..afd3479 100644
--- a/sound/soc/fsl/Makefile
+++ b/sound/soc/fsl/Makefile
@@ -30,14 +30,18 @@ obj-$(CONFIG_SND_MPC52xx_SOC_EFIKA) += efika-audio-fabric.o
 # i.MX Platform Support
 snd-soc-imx-ssi-objs := imx-ssi.o
 snd-soc-imx-audmux-objs := imx-audmux.o
+snd-soc-imx-pcm-objs := imx-pcm.o
+ifneq ($(CONFIG_SND_SOC_IMX_PCM_FIQ),)
+	snd-soc-imx-pcm-objs += imx-pcm-fiq.o
+endif
+ifneq ($(CONFIG_SND_SOC_IMX_PCM_DMA),)
+	snd-soc-imx-pcm-objs += imx-pcm-dma.o
+endif
 
 obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o
 obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o
 
 obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o
-snd-soc-imx-pcm-y := imx-pcm.o
-snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += imx-pcm-fiq.o
-snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_DMA) += imx-pcm-dma.o
 
 # i.MX Machine Support
 snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o
-- 
1.7.2.5


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

* Re: [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  9:12       ` [PATCH v2] " Lothar Waßmann
@ 2012-11-23 10:08         ` Mark Brown
  2012-11-23 10:21           ` Lothar Waßmann
  2012-11-27 19:36         ` [PATCH v2] " Mark Brown
  2012-11-27 19:37         ` Mark Brown
  2 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23 10:08 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 10:12:13AM +0100, Lothar Waßmann wrote:
> Due to a broken make rule, sound/soc/fsl/imx-pcm-dma.c or
> sound/soc/fsl/imx-pcm-fiq.c (whatever is selected via Kconfig) will
> not be compiled into imx-pcm.o when building as module, i.e.:

What I've been trying to do is get you to tell me what the problem is
with the Makefile rule, it's really not clear to me what the issue is or
why your change is better.  I can see the practical results but nothing
about how they came to be which makes it very hard to tell if this is a
good fix.

This is a common issue with stuff you send, there's lots of analysis
missing so it's hard to understand the thought process behind the
change.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23 10:08         ` Mark Brown
@ 2012-11-23 10:21           ` Lothar Waßmann
  2012-11-23 11:47             ` Mark Brown
  0 siblings, 1 reply; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-23 10:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel

Hi,

Mark Brown writes:
> On Fri, Nov 23, 2012 at 10:12:13AM +0100, Lothar Waßmann wrote:
> > Due to a broken make rule, sound/soc/fsl/imx-pcm-dma.c or
> > sound/soc/fsl/imx-pcm-fiq.c (whatever is selected via Kconfig) will
> > not be compiled into imx-pcm.o when building as module, i.e.:
> 
> What I've been trying to do is get you to tell me what the problem is
> with the Makefile rule, it's really not clear to me what the issue is or
> why your change is better.  I can see the practical results but nothing
> about how they came to be which makes it very hard to tell if this is a
> good fix.
> 
I already included the actual error messages I got when loading the
sound module.
I also mentioned, that in case of module build some source files
aren't being compiled with those rules. What else do you expect?


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

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

* Re: [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23 10:21           ` Lothar Waßmann
@ 2012-11-23 11:47             ` Mark Brown
  2012-11-26  8:50               ` [PATCH v3] " Lothar Waßmann
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23 11:47 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 11:21:42AM +0100, Lothar Waßmann wrote:

> I already included the actual error messages I got when loading the
> sound module.
> I also mentioned, that in case of module build some source files
> aren't being compiled with those rules. What else do you expect?

The why part of things - what is the reason there was a problem and how
does your change address it?  What is it that you believe your patch
does to address the problem?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] ASoC: imx: add MODULE_LICENSE("GPL")
  2012-11-22 12:31 ` [PATCH] ASoC: imx: add MODULE_LICENSE("GPL") Lothar Waßmann
@ 2012-11-23 14:40   ` Mark Brown
  0 siblings, 0 replies; 21+ messages in thread
From: Mark Brown @ 2012-11-23 14:40 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Thu, Nov 22, 2012 at 01:31:07PM +0100, Lothar Waßmann wrote:
> also set MODULE_AUTHOR and MODULE_DESCRIPTION

Applied, thanks.  But as ever please do write better changelogs, for
example "Add MODULE_ information" or something as the subject.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use
  2012-11-22 12:31 ` [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use Lothar Waßmann
@ 2012-11-23 14:42   ` Mark Brown
  0 siblings, 0 replies; 21+ messages in thread
From: Mark Brown @ 2012-11-23 14:42 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Thu, Nov 22, 2012 at 01:31:08PM +0100, Lothar Waßmann wrote:
> set the 'onwer' field of the registered snd_soc_card object to prevent
> removal of the module when its resources are in use.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk
  2012-11-23  7:21     ` Lothar Waßmann
@ 2012-11-23 14:45       ` Mark Brown
  2012-11-26  8:49         ` Lothar Waßmann
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Brown @ 2012-11-23 14:45 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 08:21:22AM +0100, Lothar Waßmann wrote:
> > On Thu, Nov 22, 2012 at 01:31:09PM +0100, Lothar Waßmann wrote:

> > Why?

> I thought that was obvious... To be able to compile the mxs sound
> driver as module.

Do you want to add new users of these functions, or are there existing
users which currently fail to link when built as modules?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk
  2012-11-23 14:45       ` Mark Brown
@ 2012-11-26  8:49         ` Lothar Waßmann
  0 siblings, 0 replies; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-26  8:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel

Hi,

Mark Brown writes:
> On Fri, Nov 23, 2012 at 08:21:22AM +0100, Lothar Waßmann wrote:
> > > On Thu, Nov 22, 2012 at 01:31:09PM +0100, Lothar Waßmann wrote:
> 
> > > Why?
> 
> > I thought that was obvious... To be able to compile the mxs sound
> > driver as module.
> 
> Do you want to add new users of these functions, or are there existing
> users which currently fail to link when built as modules?
>
The existing MXS sound driver fails to build as module
(CONFIG_SND_SOC_MXS_SGTL5000=m) without this patch.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

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

* [PATCH v3] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23 11:47             ` Mark Brown
@ 2012-11-26  8:50               ` Lothar Waßmann
  0 siblings, 0 replies; 21+ messages in thread
From: Lothar Waßmann @ 2012-11-26  8:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Shawn Guo, linux-kernel, Lothar Waßmann

Hi Mark,

thanks your insisting on a better description for the patch, I found a
more appropriate solution for the problem: 

Compiling the SoC Audio driver for Freescale i.MX as a module
(CONFIG_SND_SOC_IMX_PCM=m) results in a non-functional sound driver
indicated by the error message:
| imx-sgtl5000 sound.1: platform imx-pcm-audio not registered
| imx-sgtl5000 sound.1: snd_soc_register_card failed (-517)
| platform sound.1: Driver imx-sgtl5000 requests probe deferral
instead of the message:
| imx-sgtl5000 sound.1:  sgtl5000 <-> 63fcc000.ssi mapping ok
that is to be expected upon loading the snd-soc-imx-pcm.ko module.

The build log reveals, that the file imx-pcm-dma.o (or imx-pcm-fiq.o
depending on the kernel configuration), which should be linked
together with imx-pcm.o into snd-imx-pcm.ko, is not being compiled in
this case.

The make rules for these files shows that the target object imx-pcm.o
is assigned to the variable snd-soc-imx-pcm-y while
imx-pcm-{dma,fiq}.o are added to to
snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_DMA) and
snd-soc-imx-pcm-$(CONFIG_SND_SOC_IMX_PCM_FIQ) which resolve to
snd-soc-imx-pcm-m in this case.

According to Documentation/kbuild/modules.txt:
|When the module is built from multiple sources, an additional line is
|needed listing the files:
|
|        <module_name>-y := <src1>.o <src2>.o ...
Thus the type of the config variables CONFIG_SND_SOC_IMX_PCM_DMA and
CONFIG_SND_SOC_IMX_PCM_FIQ should be 'bool' instead of 'tristate' to
resolve to 'y' when selected.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 10fd172..3b98159 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -112,12 +112,12 @@ config SND_SOC_IMX_PCM
 	tristate
 
 config SND_SOC_IMX_PCM_FIQ
-	tristate
+	bool
 	select FIQ
 	select SND_SOC_IMX_PCM
 
 config SND_SOC_IMX_PCM_DMA
-	tristate
+	bool
 	select SND_SOC_DMAENGINE_PCM
 	select SND_SOC_IMX_PCM
 
-- 
1.7.2.5


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

* Re: [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  9:12       ` [PATCH v2] " Lothar Waßmann
  2012-11-23 10:08         ` Mark Brown
@ 2012-11-27 19:36         ` Mark Brown
  2012-11-27 19:37         ` Mark Brown
  2 siblings, 0 replies; 21+ messages in thread
From: Mark Brown @ 2012-11-27 19:36 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 10:12:13AM +0100, Lothar Waßmann wrote:
> Due to a broken make rule, sound/soc/fsl/imx-pcm-dma.c or
> sound/soc/fsl/imx-pcm-fiq.c (whatever is selected via Kconfig) will
> not be compiled into imx-pcm.o when building as module, i.e.:
> CONFIG_SND_SOC_IMX_PCM=m
> CONFIG_SND_SOC_IMX_PCM_DMA=m
> resulting in a non-functional sound driver.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v2] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm
  2012-11-23  9:12       ` [PATCH v2] " Lothar Waßmann
  2012-11-23 10:08         ` Mark Brown
  2012-11-27 19:36         ` [PATCH v2] " Mark Brown
@ 2012-11-27 19:37         ` Mark Brown
  2 siblings, 0 replies; 21+ messages in thread
From: Mark Brown @ 2012-11-27 19:37 UTC (permalink / raw)
  To: Lothar Waßmann; +Cc: alsa-devel, Shawn Guo, linux-kernel

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

On Fri, Nov 23, 2012 at 10:12:13AM +0100, Lothar Waßmann wrote:
> Due to a broken make rule, sound/soc/fsl/imx-pcm-dma.c or
> sound/soc/fsl/imx-pcm-fiq.c (whatever is selected via Kconfig) will
> not be compiled into imx-pcm.o when building as module, i.e.:
> CONFIG_SND_SOC_IMX_PCM=m
> CONFIG_SND_SOC_IMX_PCM_DMA=m
> resulting in a non-functional sound driver.

Sorry, replied to the wrong version here - I did apply v3.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

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

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22 12:31 [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Lothar Waßmann
2012-11-22 12:31 ` [PATCH] ASoC: imx: add MODULE_LICENSE("GPL") Lothar Waßmann
2012-11-23 14:40   ` Mark Brown
2012-11-22 12:31 ` [BUGFIX PATCH] ASoC: imx-sgtl5000: prevent module from being unloaded when in use Lothar Waßmann
2012-11-23 14:42   ` Mark Brown
2012-11-22 12:31 ` [PATCH] ASoC: mxs-saif: export mxs_saif_put_mclk,mxs_saif_get_mclk Lothar Waßmann
2012-11-23  2:06   ` Mark Brown
2012-11-23  7:21     ` Lothar Waßmann
2012-11-23 14:45       ` Mark Brown
2012-11-26  8:49         ` Lothar Waßmann
2012-11-22 12:31 ` [PATCH] ASoC: dmaengine_pcm: set MODULE_LICENSE Lothar Waßmann
2012-11-23  2:05 ` [BUGFIX PATCH] ASoC: fsl: fix miscompilation of snd-soc-imx-pcm Mark Brown
2012-11-23  6:59   ` Lothar Waßmann
2012-11-23  8:13     ` Mark Brown
2012-11-23  9:12       ` [PATCH v2] " Lothar Waßmann
2012-11-23 10:08         ` Mark Brown
2012-11-23 10:21           ` Lothar Waßmann
2012-11-23 11:47             ` Mark Brown
2012-11-26  8:50               ` [PATCH v3] " Lothar Waßmann
2012-11-27 19:36         ` [PATCH v2] " Mark Brown
2012-11-27 19:37         ` Mark Brown

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