diff mbox

ASoC: Failed to create DAPM debugfs

Message ID 55262C9D.5080005@metafoo.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lars-Peter Clausen April 9, 2015, 7:39 a.m. UTC
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:

Comments

Nicolin Chen April 9, 2015, 8:22 a.m. UTC | #1
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
Lars-Peter Clausen April 9, 2015, 8:29 a.m. UTC | #2
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
diff mbox

Patch

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