From patchwork Thu Apr 9 08:45:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 6184611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98F37BF4A6 for ; Thu, 9 Apr 2015 08:46:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D65C120155 for ; Thu, 9 Apr 2015 08:46:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 853E9203C1 for ; Thu, 9 Apr 2015 08:46:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 65E292658E8; Thu, 9 Apr 2015 10:46:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7EE97265467; Thu, 9 Apr 2015 10:46:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 08AE926588E; Thu, 9 Apr 2015 10:46:27 +0200 (CEST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by alsa0.perex.cz (Postfix) with ESMTP id B7BB2265268 for ; Thu, 9 Apr 2015 10:45:15 +0200 (CEST) Received: by pacyx8 with SMTP id yx8so142697974pac.1 for ; Thu, 09 Apr 2015 01:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ydhIrmqNRGVbgVs8aSxsp1zga+DmSWjYIlHOrTxctEY=; b=jGMIYP+oc5kYrRInmXt50S9bhVkHL3yilGKHrkio7XBDh54W9gZgsRw7gJPfQ8IEp2 WMvHVeyQFuyNYhrVv2HksHUG4KaBA6Pb6Hc3f+BdhZzF3lN1HCxBkTZbHFOhAmX/HUTo K+dALymQFgxwtlHkJ8y3YZ100SGMrMihVoQSDYtG0uKhizB9ma+WJwLAOdRPUNikSl/c pxwsIrl2mmp3AWFrcgxRIarm3w7W1cdOI4grKakzaxsr6Ss+bUOtcnd6R43Ey8mfViK5 0EpqFdz2acVaFr4cJqUGo1hdHbVHcG/LI7tponeCECE2ReKLLGaUIg3A0taffywbUShC Q75w== X-Received: by 10.68.180.195 with SMTP id dq3mr54406921pbc.39.1428569113637; Thu, 09 Apr 2015 01:45:13 -0700 (PDT) Received: from Asurada-CZ80 ([2601:9:5980:19de:1da2:19a2:a448:c280]) by mx.google.com with ESMTPSA id xv9sm13506043pbc.2.2015.04.09.01.45.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 Apr 2015 01:45:13 -0700 (PDT) Date: Thu, 9 Apr 2015 01:45:10 -0700 From: Nicolin Chen To: Lars-Peter Clausen Message-ID: <20150409084509.GC62585@Asurada-CZ80> References: <55258272.2010205@metafoo.de> <55262C9D.5080005@metafoo.de> <20150409082246.GB62585@Asurada-CZ80> <55263873.108@metafoo.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55263873.108@metafoo.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Russell King , "alsa-devel@alsa-project.org" , Mark Brown , Fabio Estevam , Kuninori Morimoto Subject: Re: [alsa-devel] ASoC: Failed to create DAPM debugfs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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: