linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
@ 2016-08-01 23:36 Kevin Hilman
  2016-08-02  1:13 ` Kuninori Morimoto
  2016-08-08 14:18 ` [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Sekhar Nori
  0 siblings, 2 replies; 10+ messages in thread
From: Kevin Hilman @ 2016-08-01 23:36 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: alsa-devel, Sekhar Nori, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto, open list

An ASoC driver using simple-card, when built as a module gets the
following error at module load time:

[   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
[   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)

fix this by including simple-card-utils.o symbols in the module build
its symols are resolved correctly.

Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
with all of ASoC built as modules.

Cc: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 sound/soc/generic/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/generic/Makefile b/sound/soc/generic/Makefile
index 45602ca8536e..ff0c55eee4f7 100644
--- a/sound/soc/generic/Makefile
+++ b/sound/soc/generic/Makefile
@@ -2,4 +2,8 @@ obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) := simple-card-utils.o
 
 snd-soc-simple-card-objs	:= simple-card.o
 
+ifneq ($(CONFIG_SND_SIMPLE_CARD_UTILS),)
+snd-soc-simple-card-objs	+=  simple-card-utils.o
+endif
+
 obj-$(CONFIG_SND_SIMPLE_CARD)	+= snd-soc-simple-card.o
-- 
2.9.0

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

* Re: [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
  2016-08-01 23:36 [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Kevin Hilman
@ 2016-08-02  1:13 ` Kuninori Morimoto
  2016-08-02  2:40   ` Kevin Hilman
  2016-08-08 14:18 ` [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Sekhar Nori
  1 sibling, 1 reply; 10+ messages in thread
From: Kuninori Morimoto @ 2016-08-02  1:13 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Liam Girdwood, Mark Brown, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list


Hi Kevin

Thank you for your patch

> An ASoC driver using simple-card, when built as a module gets the
> following error at module load time:
> 
> [   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
> [   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
> 
> fix this by including simple-card-utils.o symbols in the module build
> its symols are resolved correctly.
> 
> Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
> with all of ASoC built as modules.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---

Hmm... strange...

simple-card-utils will be used not only simple-card in the future,
thus it should be build separately.

And, snd_soc_of_parse_daifmt() and snd_soc_of_parse_card_name() are
already exported on soc-core.c ?

I tried it as module, but no error for me

...
  CHK     kernel/config_data.h
  LD      sound/soc/generic/built-in.o
  CC [M]  sound/soc/generic/simple-card-utils.o
  CC [M]  sound/soc/generic/simple-card.o
  LD [M]  sound/soc/generic/snd-soc-simple-card.o
  LD      sound/soc/built-in.o
  LD      sound/built-in.o
...
  MODPOST 7 modules
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/Image is ready
  CC      sound/soc/generic/simple-card-utils.mod.o
  CC      sound/soc/generic/snd-soc-simple-card.mod.o
  GZIP    arch/arm/boot/compressed/piggy_data
  LD [M]  sound/soc/generic/simple-card-utils.ko
  LD [M]  sound/soc/generic/snd-soc-simple-card.ko
  AS      arch/arm/boot/compressed/piggy.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready



Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
  2016-08-02  1:13 ` Kuninori Morimoto
@ 2016-08-02  2:40   ` Kevin Hilman
  2016-08-02  3:22     ` [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx() Kuninori Morimoto
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Hilman @ 2016-08-02  2:40 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Liam Girdwood, Mark Brown, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list

On Mon, Aug 1, 2016 at 6:13 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> Hi Kevin
>
> Thank you for your patch
>
>> An ASoC driver using simple-card, when built as a module gets the
>> following error at module load time:
>>
>> [   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
>> [   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
>>
>> fix this by including simple-card-utils.o symbols in the module build
>> its symols are resolved correctly.
>>
>> Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
>> with all of ASoC built as modules.
>>
>> Cc: Sekhar Nori <nsekhar@ti.com>
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>> ---
>
> Hmm... strange...
>
> simple-card-utils will be used not only simple-card in the future,
> thus it should be build separately.
>
> And, snd_soc_of_parse_daifmt() and snd_soc_of_parse_card_name() are
> already exported on soc-core.c ?
>
> I tried it as module, but no error for me

The error I'm getting is not at build time, but at module load time.

The various snd related modules are autoloaded by udev events, but
during that time I see this:

[   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
[   23.712726] simple_card_utils: Unknown symbol
snd_soc_of_parse_card_name (err 0)

and my patch fixes that problem so that the module symbols resolve at load time.

Kevin

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

* [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx()
  2016-08-02  2:40   ` Kevin Hilman
@ 2016-08-02  3:22     ` Kuninori Morimoto
  2016-08-02 18:11       ` Mark Brown
  2016-08-02 18:50       ` Kevin Hilman
  0 siblings, 2 replies; 10+ messages in thread
From: Kuninori Morimoto @ 2016-08-02  3:22 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Liam Girdwood, Mark Brown, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

simple-card-utils might be used as module, but MODULE_xxx()
information was missed. This patch adds it.
Otherwise, we will have below error, and can't use it.
Specil thanks to Kevin.

> insmod simple-card-utils.ko
simple_card_utils: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
insmod: can't insert 'simple-card-utils.ko': \
        unknown symbol in module, or unknown parameter

Reported-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---

>> Kevin

Thank you for your report. I think this patch can solve your issue.
Can you check this ?

 sound/soc/generic/Makefile            | 6 +++---
 sound/soc/generic/simple-card-utils.c | 7 +++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/sound/soc/generic/Makefile b/sound/soc/generic/Makefile
index 45602ca..2d53c8d 100644
--- a/sound/soc/generic/Makefile
+++ b/sound/soc/generic/Makefile
@@ -1,5 +1,5 @@
-obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) := simple-card-utils.o
-
+snd-soc-simple-card-utils-objs	:= simple-card-utils.o
 snd-soc-simple-card-objs	:= simple-card.o
 
-obj-$(CONFIG_SND_SIMPLE_CARD)	+= snd-soc-simple-card.o
+obj-$(CONFIG_SND_SIMPLE_CARD_UTILS)	+= snd-soc-simple-card-utils.o
+obj-$(CONFIG_SND_SIMPLE_CARD)		+= snd-soc-simple-card.o
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index d89a9a1..c0a726a 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -7,6 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/of.h>
 #include <sound/simple_card_utils.h>
 
@@ -95,3 +96,9 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 	return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
+
+/* Module information */
+MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
+MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:asoc-simple-card-utils");
-- 
1.9.1

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

* Re: [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx()
  2016-08-02  3:22     ` [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx() Kuninori Morimoto
@ 2016-08-02 18:11       ` Mark Brown
  2016-08-02 18:50       ` Kevin Hilman
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2016-08-02 18:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Kevin Hilman, Liam Girdwood, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list

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

On Tue, Aug 02, 2016 at 03:22:08AM +0000, Kuninori Morimoto wrote:

> +MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
> +MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");
> +MODULE_LICENSE("GPL v2");

This lot is what is needed (well, just the MODULE_LICENSE).

> +MODULE_ALIAS("platform:asoc-simple-card-utils");

This is wrong, this isn't a driver but rather a library that's used by
other modules so it shouldn't have an alias.  The aliases are there to
let modutils know which module to load for a device that it sees.

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

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

* Re: [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx()
  2016-08-02  3:22     ` [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx() Kuninori Morimoto
  2016-08-02 18:11       ` Mark Brown
@ 2016-08-02 18:50       ` Kevin Hilman
  2016-08-02 19:41         ` Mark Brown
  1 sibling, 1 reply; 10+ messages in thread
From: Kevin Hilman @ 2016-08-02 18:50 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Liam Girdwood, Mark Brown, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list

Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> writes:

> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> simple-card-utils might be used as module, but MODULE_xxx()
> information was missed. This patch adds it.
> Otherwise, we will have below error, and can't use it.
> Specil thanks to Kevin.
>
>> insmod simple-card-utils.ko
> simple_card_utils: module license 'unspecified' taints kernel.
> Disabling lock debugging due to kernel taint
> simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
> simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
> insmod: can't insert 'simple-card-utils.ko': \
>         unknown symbol in module, or unknown parameter
>
> Reported-by: Kevin Hilman <khilman@baylibre.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>
>>> Kevin
>
> Thank you for your report. I think this patch can solve your issue.
> Can you check this ?

Your patch works, but as Mark pointed out, I didn't think that this was
the right fix as this isn't a module, but just library.

Kevin

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

* Re: [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx()
  2016-08-02 18:50       ` Kevin Hilman
@ 2016-08-02 19:41         ` Mark Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2016-08-02 19:41 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Kuninori Morimoto, Liam Girdwood, alsa-devel, Sekhar Nori,
	Jaroslav Kysela, Takashi Iwai, open list

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

On Tue, Aug 02, 2016 at 11:50:48AM -0700, Kevin Hilman wrote:

> Your patch works, but as Mark pointed out, I didn't think that this was
> the right fix as this isn't a module, but just library.

I think building the library as a module is fine, that way we can load
it only in situations where it's used, it's just that it should be
pulled in by the relevant driver.

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

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

* Re: [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
  2016-08-01 23:36 [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Kevin Hilman
  2016-08-02  1:13 ` Kuninori Morimoto
@ 2016-08-08 14:18 ` Sekhar Nori
  2016-08-09  0:26   ` Kuninori Morimoto
  1 sibling, 1 reply; 10+ messages in thread
From: Sekhar Nori @ 2016-08-08 14:18 UTC (permalink / raw)
  To: Kevin Hilman, Liam Girdwood, Mark Brown
  Cc: alsa-devel, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto, open list

On Tuesday 02 August 2016 05:06 AM, Kevin Hilman wrote:
> An ASoC driver using simple-card, when built as a module gets the
> following error at module load time:
> 
> [   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
> [   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
> 
> fix this by including simple-card-utils.o symbols in the module build
> its symols are resolved correctly.
> 
> Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
> with all of ASoC built as modules.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>

Tested with audio on DaVinci DA850 EVM.

Tested-by: Sekhar Nori <nsekhar@ti.com>

Regards,
Sekhar

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

* Re: [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
  2016-08-08 14:18 ` [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Sekhar Nori
@ 2016-08-09  0:26   ` Kuninori Morimoto
  2016-08-09  6:49     ` Sekhar Nori
  0 siblings, 1 reply; 10+ messages in thread
From: Kuninori Morimoto @ 2016-08-09  0:26 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Kevin Hilman, Liam Girdwood, Mark Brown, alsa-devel,
	Jaroslav Kysela, Takashi Iwai, open list


Hi Sekhar

> > An ASoC driver using simple-card, when built as a module gets the
> > following error at module load time:
> > 
> > [   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
> > [   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
> > 
> > fix this by including simple-card-utils.o symbols in the module build
> > its symols are resolved correctly.
> > 
> > Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
> > with all of ASoC built as modules.
> > 
> > Cc: Sekhar Nori <nsekhar@ti.com>
> > Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> 
> Tested with audio on DaVinci DA850 EVM.
> 
> Tested-by: Sekhar Nori <nsekhar@ti.com>

I think this issue was solved by this patch on Mark/fix/simple

1f85e118c81d15aa9e002604dfb69c823d4aac16
("ASoC: simple-card-utils: add missing MODULE_xxx()")

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

* Re: [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue
  2016-08-09  0:26   ` Kuninori Morimoto
@ 2016-08-09  6:49     ` Sekhar Nori
  0 siblings, 0 replies; 10+ messages in thread
From: Sekhar Nori @ 2016-08-09  6:49 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Kevin Hilman, Liam Girdwood, Mark Brown, alsa-devel,
	Jaroslav Kysela, Takashi Iwai, open list

On Tuesday 09 August 2016 05:56 AM, Kuninori Morimoto wrote:
> 
> Hi Sekhar
> 
>>> An ASoC driver using simple-card, when built as a module gets the
>>> following error at module load time:
>>>
>>> [   23.571873] simple_card_utils: Unknown symbol snd_soc_of_parse_daifmt (err 0)
>>> [   23.712726] simple_card_utils: Unknown symbol snd_soc_of_parse_card_name (err 0)
>>>
>>> fix this by including simple-card-utils.o symbols in the module build
>>> its symols are resolved correctly.
>>>
>>> Tested on Davinci DA850-EVM using snd_soc_edma, snc_soc_davinci_mcasp,
>>> with all of ASoC built as modules.
>>>
>>> Cc: Sekhar Nori <nsekhar@ti.com>
>>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>>
>> Tested with audio on DaVinci DA850 EVM.
>>
>> Tested-by: Sekhar Nori <nsekhar@ti.com>
> 
> I think this issue was solved by this patch on Mark/fix/simple
> 
> 1f85e118c81d15aa9e002604dfb69c823d4aac16
> ("ASoC: simple-card-utils: add missing MODULE_xxx()")

I see it in -next. Thanks!

Regards,
Sekhar

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

end of thread, other threads:[~2016-08-09  6:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 23:36 [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Kevin Hilman
2016-08-02  1:13 ` Kuninori Morimoto
2016-08-02  2:40   ` Kevin Hilman
2016-08-02  3:22     ` [PATCH] ASoC: simple-card-utils: add missing MODULE_xxx() Kuninori Morimoto
2016-08-02 18:11       ` Mark Brown
2016-08-02 18:50       ` Kevin Hilman
2016-08-02 19:41         ` Mark Brown
2016-08-08 14:18 ` [PATCH] ASoC: simple-card: fix module load "unknown symbol" issue Sekhar Nori
2016-08-09  0:26   ` Kuninori Morimoto
2016-08-09  6:49     ` Sekhar Nori

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