All of lore.kernel.org
 help / color / mirror / Atom feed
* ASoC: Failed to create DAPM debugfs
@ 2015-04-08 18:31 Fabio Estevam
  2015-04-08 19:33 ` Lars-Peter Clausen
  2015-04-08 19:44 ` Mark Brown
  0 siblings, 2 replies; 11+ messages in thread
From: Fabio Estevam @ 2015-04-08 18:31 UTC (permalink / raw)
  To: Mark Brown; +Cc: Nicolin Chen, alsa-devel, Lars-Peter Clausen, Russell King

Hi,

On a imx6q-hummingboard the following warning is seen when running
linux-next 20150408:

[    2.270006] imx-spdif sound-spdif: ASoC: Failed to create DAPM
debugfs directory

Looking at sound/soc/fsl/imx-spdif.c and sound/soc/fsl/fsl_spdif.c I
am not sure how to avoid such warning.

Any ideas?

Thanks,

Fabio Estevam

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-08 18:31 ASoC: Failed to create DAPM debugfs Fabio Estevam
@ 2015-04-08 19:33 ` Lars-Peter Clausen
  2015-04-08 20:35   ` Fabio Estevam
  2015-04-08 19:44 ` Mark Brown
  1 sibling, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-04-08 19:33 UTC (permalink / raw)
  To: Fabio Estevam, Mark Brown; +Cc: Nicolin Chen, alsa-devel, Russell King

On 04/08/2015 08:31 PM, Fabio Estevam wrote:
> Hi,
>
> On a imx6q-hummingboard the following warning is seen when running
> linux-next 20150408:
>
> [    2.270006] imx-spdif sound-spdif: ASoC: Failed to create DAPM
> debugfs directory
>
> Looking at sound/soc/fsl/imx-spdif.c and sound/soc/fsl/fsl_spdif.c I
> am not sure how to avoid such warning.
>
> Any ideas?

Does the card name contain a '/' like in 'S/PDIF'?

- Lars

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-08 18:31 ASoC: Failed to create DAPM debugfs Fabio Estevam
  2015-04-08 19:33 ` Lars-Peter Clausen
@ 2015-04-08 19:44 ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2015-04-08 19:44 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Nicolin Chen, alsa-devel, Lars-Peter Clausen, Russell King


[-- Attachment #1.1: Type: text/plain, Size: 743 bytes --]

On Wed, Apr 08, 2015 at 03:31:44PM -0300, Fabio Estevam wrote:

> On a imx6q-hummingboard the following warning is seen when running
> linux-next 20150408:

> [    2.270006] imx-spdif sound-spdif: ASoC: Failed to create DAPM
> debugfs directory

> Looking at sound/soc/fsl/imx-spdif.c and sound/soc/fsl/fsl_spdif.c I
> am not sure how to avoid such warning.

> Any ideas?

Some slightly larger hints as to the analysis you did which makes you
think this is unavoidable might help here, as would information about
when this stopped working...  it looks like one of those is a card
driver and the other is a DAI driver both for separate devices which is
a configuration I'd expect to work?  I only looked at this for a couple
of minutes so far.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-08 19:33 ` Lars-Peter Clausen
@ 2015-04-08 20:35   ` Fabio Estevam
  2015-04-09  7:39     ` Lars-Peter Clausen
  0 siblings, 1 reply; 11+ messages in thread
From: Fabio Estevam @ 2015-04-08 20:35 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Nicolin Chen, alsa-devel, Mark Brown, Russell King

On Wed, Apr 8, 2015 at 4:33 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:

> Does the card name contain a '/' like in 'S/PDIF'?

Yes, it does. I also tried to change it like this:

--- a/sound/soc/fsl/imx-spdif.c
+++ b/sound/soc/fsl/imx-spdif.c
@@ -37,8 +37,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
                goto end;
        }

-       data->dai.name = "S/PDIF PCM";
-       data->dai.stream_name = "S/PDIF PCM";
+       data->dai.name = "SPDIF PCM";
+       data->dai.stream_name = "SPDIF PCM";
        data->dai.codec_dai_name = "snd-soc-dummy-dai";
        data->dai.codec_name = "snd-soc-dummy";
        data->dai.cpu_of_node = spdif_np;

,but I still get the warning.

Thanks,

Fabio Estevam

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-08 20:35   ` Fabio Estevam
@ 2015-04-09  7:39     ` Lars-Peter Clausen
  2015-04-09  8:22       ` Nicolin Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-04-09  7:39 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Nicolin Chen, alsa-devel, Mark Brown, Russell King

On 04/08/2015 10:35 PM, Fabio Estevam wrote:
> On Wed, Apr 8, 2015 at 4:33 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>
>> Does the card name contain a '/' like in 'S/PDIF'?
>
> Yes, it does. I also tried to change it like this:
>
> --- a/sound/soc/fsl/imx-spdif.c
> +++ b/sound/soc/fsl/imx-spdif.c
> @@ -37,8 +37,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
>                  goto end;
>          }
>
> -       data->dai.name = "S/PDIF PCM";
> -       data->dai.stream_name = "S/PDIF PCM";
> +       data->dai.name = "SPDIF PCM";
> +       data->dai.stream_name = "SPDIF PCM";
>          data->dai.codec_dai_name = "snd-soc-dummy-dai";
>          data->dai.codec_name = "snd-soc-dummy";
>          data->dai.cpu_of_node = spdif_np;
>
> ,but I still get the warning.

That's the DAI name, which could cause problems on its own. But not the one 
you are seeing right now.

The whole thing is a bit confusing. The message you get is what you'd get if 
the 'dapm' sub-directory in the card debugfs directory can not be created. 
One of the few reasons why it would fail is if it already existed, but we 
should never register two dapm contexts for the card, so that's a bit 
strange. One of the few reasons I can imagine this could happen is if the 
parent directory could not be created and now we try to create multiple dapm 
directories at the top-level.

Try to do some more debugging and see why and where exactly things go wrong. 
Can you also try this:

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b6f8820..7810262 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1898,6 +1898,11 @@
  {
  	struct dentry *d;

+	if (!parent) {
+		dev_warn(dapm->dev, "No debugfs parent!\n");
+		return;
+	}
+
  	dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);

  	if (!dapm->debugfs_dapm) {

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09  7:39     ` Lars-Peter Clausen
@ 2015-04-09  8:22       ` Nicolin Chen
  2015-04-09  8:29         ` Lars-Peter Clausen
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolin Chen @ 2015-04-09  8:22 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Russell King, alsa-devel, Mark Brown, Fabio Estevam

On Thu, Apr 09, 2015 at 09:39:09AM +0200, Lars-Peter Clausen wrote:

> The whole thing is a bit confusing. The message you get is what
> you'd get if the 'dapm' sub-directory in the card debugfs directory
> can not be created. One of the few reasons why it would fail is if
> it already existed, but we should never register two dapm contexts
> for the card, so that's a bit strange. One of the few reasons I can
> imagine this could happen is if the parent directory could not be
> created and now we try to create multiple dapm directories at the
> top-level.
> 
> Try to do some more debugging and see why and where exactly things
> go wrong. Can you also try this:
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index b6f8820..7810262 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -1898,6 +1898,11 @@
>  {
>  	struct dentry *d;
> 
> +	if (!parent) {
> +		dev_warn(dapm->dev, "No debugfs parent!\n");

I tried, yes, the parent is NULL. And I did a little tracing and found
that the card->debugfs_root, which is NULL, should be initialized in
the soc_init_card_debugfs() while snd_soc_dapm_debugfs_init() seems
to access this card->debugfs_root before calling soc_init_card_debugfs().

I think I must have missed something over here....

Thank you
Nicolin

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09  8:22       ` Nicolin Chen
@ 2015-04-09  8:29         ` Lars-Peter Clausen
  2015-04-09  8:45           ` Nicolin Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-04-09  8:29 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: Russell King, alsa-devel, Mark Brown, Fabio Estevam, Kuninori Morimoto

On 04/09/2015 10:22 AM, Nicolin Chen wrote:
> On Thu, Apr 09, 2015 at 09:39:09AM +0200, Lars-Peter Clausen wrote:
>
>> The whole thing is a bit confusing. The message you get is what
>> you'd get if the 'dapm' sub-directory in the card debugfs directory
>> can not be created. One of the few reasons why it would fail is if
>> it already existed, but we should never register two dapm contexts
>> for the card, so that's a bit strange. One of the few reasons I can
>> imagine this could happen is if the parent directory could not be
>> created and now we try to create multiple dapm directories at the
>> top-level.
>>
>> Try to do some more debugging and see why and where exactly things
>> go wrong. Can you also try this:
>>
>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
>> index b6f8820..7810262 100644
>> --- a/sound/soc/soc-dapm.c
>> +++ b/sound/soc/soc-dapm.c
>> @@ -1898,6 +1898,11 @@
>>   {
>>   	struct dentry *d;
>>
>> +	if (!parent) {
>> +		dev_warn(dapm->dev, "No debugfs parent!\n");
>
> I tried, yes, the parent is NULL. And I did a little tracing and found
> that the card->debugfs_root, which is NULL, should be initialized in
> the soc_init_card_debugfs() while snd_soc_dapm_debugfs_init() seems
> to access this card->debugfs_root before calling soc_init_card_debugfs().
>
> I think I must have missed something over here....

Looks like this is the culprit: 
http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=4e2576bd36a12e78ac3786d05b99a820dffe687f

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09  8:29         ` Lars-Peter Clausen
@ 2015-04-09  8:45           ` Nicolin Chen
  2015-04-09  8:55             ` Lars-Peter Clausen
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolin Chen @ 2015-04-09  8:45 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Russell King, alsa-devel, Mark Brown, Fabio Estevam, Kuninori Morimoto

On Thu, Apr 09, 2015 at 10:29:39AM +0200, Lars-Peter Clausen wrote:
> On 04/09/2015 10:22 AM, Nicolin Chen wrote:
> >On Thu, Apr 09, 2015 at 09:39:09AM +0200, Lars-Peter Clausen wrote:
> >
> >>The whole thing is a bit confusing. The message you get is what
> >>you'd get if the 'dapm' sub-directory in the card debugfs directory
> >>can not be created. One of the few reasons why it would fail is if
> >>it already existed, but we should never register two dapm contexts
> >>for the card, so that's a bit strange. One of the few reasons I can
> >>imagine this could happen is if the parent directory could not be
> >>created and now we try to create multiple dapm directories at the
> >>top-level.
> >>
> >>Try to do some more debugging and see why and where exactly things
> >>go wrong. Can you also try this:
> >>
> >>diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> >>index b6f8820..7810262 100644
> >>--- a/sound/soc/soc-dapm.c
> >>+++ b/sound/soc/soc-dapm.c
> >>@@ -1898,6 +1898,11 @@
> >>  {
> >>  	struct dentry *d;
> >>
> >>+	if (!parent) {
> >>+		dev_warn(dapm->dev, "No debugfs parent!\n");
> >
> >I tried, yes, the parent is NULL. And I did a little tracing and found
> >that the card->debugfs_root, which is NULL, should be initialized in
> >the soc_init_card_debugfs() while snd_soc_dapm_debugfs_init() seems
> >to access this card->debugfs_root before calling soc_init_card_debugfs().
> >
> >I think I must have missed something over here....
> 
> Looks like this is the culprit: http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=4e2576bd36a12e78ac3786d05b99a820dffe687f
>

I think this patch didn't move the snd_init_card_debugfs() backwards.
It just wrapped the call at the end of snd_soc_instantiate_card().

But the snd_soc_dapm_debugfs_init() call that's going to access the
card->debugfs_root was put before the snd_init_card_debugfs() at the
first place....

I'm not sure if this could be a fix but the warning is actually gone:

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2801578..0412795 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1560,10 +1560,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 	card->dapm.card = card;
 	list_add(&card->dapm.list, &card->dapm_list);
 
-#ifdef CONFIG_DEBUG_FS
-	snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root);
-#endif
-
 #ifdef CONFIG_PM_SLEEP
 	/* deferred resume work */
 	INIT_WORK(&card->deferred_resume_work, soc_resume_deferred);
@@ -1686,6 +1682,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 
 	soc_init_card_debugfs(card);
 
+#ifdef CONFIG_DEBUG_FS
+	snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root);
+#endif
+
 	return 0;
 
 probe_aux_dev_err:

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09  8:45           ` Nicolin Chen
@ 2015-04-09  8:55             ` Lars-Peter Clausen
  2015-04-09 19:37               ` Nicolin Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2015-04-09  8:55 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: Russell King, alsa-devel, Mark Brown, Fabio Estevam, Kuninori Morimoto

On 04/09/2015 10:45 AM, Nicolin Chen wrote:
> On Thu, Apr 09, 2015 at 10:29:39AM +0200, Lars-Peter Clausen wrote:
>> On 04/09/2015 10:22 AM, Nicolin Chen wrote:
>>> On Thu, Apr 09, 2015 at 09:39:09AM +0200, Lars-Peter Clausen wrote:
>>>
>>>> The whole thing is a bit confusing. The message you get is what
>>>> you'd get if the 'dapm' sub-directory in the card debugfs directory
>>>> can not be created. One of the few reasons why it would fail is if
>>>> it already existed, but we should never register two dapm contexts
>>>> for the card, so that's a bit strange. One of the few reasons I can
>>>> imagine this could happen is if the parent directory could not be
>>>> created and now we try to create multiple dapm directories at the
>>>> top-level.
>>>>
>>>> Try to do some more debugging and see why and where exactly things
>>>> go wrong. Can you also try this:
>>>>
>>>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
>>>> index b6f8820..7810262 100644
>>>> --- a/sound/soc/soc-dapm.c
>>>> +++ b/sound/soc/soc-dapm.c
>>>> @@ -1898,6 +1898,11 @@
>>>>   {
>>>>   	struct dentry *d;
>>>>
>>>> +	if (!parent) {
>>>> +		dev_warn(dapm->dev, "No debugfs parent!\n");
>>>
>>> I tried, yes, the parent is NULL. And I did a little tracing and found
>>> that the card->debugfs_root, which is NULL, should be initialized in
>>> the soc_init_card_debugfs() while snd_soc_dapm_debugfs_init() seems
>>> to access this card->debugfs_root before calling soc_init_card_debugfs().
>>>
>>> I think I must have missed something over here....
>>
>> Looks like this is the culprit: http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=4e2576bd36a12e78ac3786d05b99a820dffe687f
>>
>
> I think this patch didn't move the snd_init_card_debugfs() backwards.
> It just wrapped the call at the end of snd_soc_instantiate_card().

Previously it was called before snd_soc_instantiate_card() and there is a 
lot of things inside snd_soc_instantiate_card() that expect the card debugfs 
directory to exist. So those now all end up at the top-level.

>
> But the snd_soc_dapm_debugfs_init() call that's going to access the
> card->debugfs_root was put before the snd_init_card_debugfs() at the
> first place....
>
> I'm not sure if this could be a fix but the warning is actually gone:

There is more stuff that expects the directory to exist in 
snd_soc_instantiate_card() so we need to move soc_init_card_debugfs() 
further up. See the patch I just sent.

>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 2801578..0412795 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1560,10 +1560,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
>   	card->dapm.card = card;
>   	list_add(&card->dapm.list, &card->dapm_list);
>
> -#ifdef CONFIG_DEBUG_FS
> -	snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root);
> -#endif
> -
>   #ifdef CONFIG_PM_SLEEP
>   	/* deferred resume work */
>   	INIT_WORK(&card->deferred_resume_work, soc_resume_deferred);
> @@ -1686,6 +1682,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
>
>   	soc_init_card_debugfs(card);
>
> +#ifdef CONFIG_DEBUG_FS
> +	snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root);
> +#endif
> +
>   	return 0;
>
>   probe_aux_dev_err:
>

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09  8:55             ` Lars-Peter Clausen
@ 2015-04-09 19:37               ` Nicolin Chen
  2015-04-10  0:05                 ` Fabio Estevam
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolin Chen @ 2015-04-09 19:37 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Russell King, alsa-devel, Mark Brown, Fabio Estevam, Kuninori Morimoto

On Thu, Apr 09, 2015 at 10:55:24AM +0200, Lars-Peter Clausen wrote:
> >But the snd_soc_dapm_debugfs_init() call that's going to access the
> >card->debugfs_root was put before the snd_init_card_debugfs() at the
> >first place....
> >
> >I'm not sure if this could be a fix but the warning is actually gone:
> 
> There is more stuff that expects the directory to exist in
> snd_soc_instantiate_card() so we need to move
> soc_init_card_debugfs() further up. See the patch I just sent.

Yea, I saw that. Thank you for the fix.

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

* Re: ASoC: Failed to create DAPM debugfs
  2015-04-09 19:37               ` Nicolin Chen
@ 2015-04-10  0:05                 ` Fabio Estevam
  0 siblings, 0 replies; 11+ messages in thread
From: Fabio Estevam @ 2015-04-10  0:05 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: Mark Brown, Lars-Peter Clausen, Russell King, alsa-devel,
	Kuninori Morimoto

On Thu, Apr 9, 2015 at 4:37 PM, Nicolin Chen <nicoleotsuka@gmail.com> wrote:
> On Thu, Apr 09, 2015 at 10:55:24AM +0200, Lars-Peter Clausen wrote:
>> >But the snd_soc_dapm_debugfs_init() call that's going to access the
>> >card->debugfs_root was put before the snd_init_card_debugfs() at the
>> >first place....
>> >
>> >I'm not sure if this could be a fix but the warning is actually gone:
>>
>> There is more stuff that expects the directory to exist in
>> snd_soc_instantiate_card() so we need to move
>> soc_init_card_debugfs() further up. See the patch I just sent.
>
> Yea, I saw that. Thank you for the fix.

Thanks for the fix, Lars!

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

end of thread, other threads:[~2015-04-10  0:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08 18:31 ASoC: Failed to create DAPM debugfs Fabio Estevam
2015-04-08 19:33 ` Lars-Peter Clausen
2015-04-08 20:35   ` Fabio Estevam
2015-04-09  7:39     ` Lars-Peter Clausen
2015-04-09  8:22       ` Nicolin Chen
2015-04-09  8:29         ` Lars-Peter Clausen
2015-04-09  8:45           ` Nicolin Chen
2015-04-09  8:55             ` Lars-Peter Clausen
2015-04-09 19:37               ` Nicolin Chen
2015-04-10  0:05                 ` Fabio Estevam
2015-04-08 19:44 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.