From patchwork Wed Feb 21 13:43:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10232713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7E54602A7 for ; Wed, 21 Feb 2018 13:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63E0328BAC for ; Wed, 21 Feb 2018 13:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5883028BB6; Wed, 21 Feb 2018 13:43:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67D2228BAC for ; Wed, 21 Feb 2018 13:43:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6CEBB267588; Wed, 21 Feb 2018 14:43:36 +0100 (CET) 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 610BF2675BF; Wed, 21 Feb 2018 14:43:33 +0100 (CET) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by alsa0.perex.cz (Postfix) with ESMTP id 85FCC267530 for ; Wed, 21 Feb 2018 14:43:29 +0100 (CET) Received: by mail-oi0-f53.google.com with SMTP id 24so1129302oij.3 for ; Wed, 21 Feb 2018 05:43:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GwQynzRJ+FDzqzCYEtKF6XafxfYUwbD9IQSIbQN2rpc=; b=X/lFA4U//kK6ijTV2qaWl/YH0upfY1WU1UgdrGQru3CMpi/NPzvAHDix8a1/Y8a1gc iE3comgCx9E88uyqOTQYHIzcU4N0GRvqjEP2zoB4mZQjwwdjiKUgigM5CXrZOsbhylcq JxT8zKVaKFygzF7npnqAYiQ9lgldWoqmS46pELTau0hZ/fsihZp9u+l4guzw6Dq/ZnrV EdwevjytuDNZCizBNDuK5uohkYAn8P9qS9i4zlUVQZqkiL/MdzMIHWWD/Zs0ErAQEbhl 6cF6X77nBjmRMAkePw6YWMogY5UJl5X87V33qIm0Ct3d2HyqQH7o11dKDyUV5vBufUCI gRSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GwQynzRJ+FDzqzCYEtKF6XafxfYUwbD9IQSIbQN2rpc=; b=UNWNFsoiWHqu1RK5oEfD7to52kms33i8QoU9wUiPJebx8VerXRDxcy+N5qEmMZaONy ymyNrWuklRF8IhrSJxiHFLkLAUlZnCX8/KYIcY3/qqjzO5eknJxAgT2ZsadVonPTemXX II1jnZRV2Ua0qrI2X5S6qCdanWudLa0DCt0X3e/QozG/Jnpt4YzFvtNW/F5yk0H4NguY Y6GRTCiqdqThaoorW+KEMzBRQkpwWp01TQI+1/GdrsQbUo6e+XTcVRtxthQlUN/lpCHu Asqui0b/bJmdCkfAe5pirArialbGu7oH26WBhYDBQIi9mRvkTwdzFa6x4HKYAi3Jnbch JIVQ== X-Gm-Message-State: APf1xPB1FibFT0VuwVSy3a3zQdkOCtAGCSnjl5lWEaMMhqqifVunO+IP 0+aSiVtMaSmXA4nJeP/Eis/DNAfIR9721oUUupI= X-Google-Smtp-Source: AH8x224ADLI+9sk754vOlRDNhHqsMwcS0+Nw29H/+Iw6Ch9QnxwJBvbF4wS85OFUoaahb3hMdVGvMiQtXyKT6fVEK9s= X-Received: by 10.202.16.24 with SMTP id 24mr2185643oiq.44.1519220607872; Wed, 21 Feb 2018 05:43:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.5.137 with HTTP; Wed, 21 Feb 2018 05:43:27 -0800 (PST) In-Reply-To: <20180221130241.GI8334@sirena.org.uk> References: <5b591fd8-d4d5-27bb-0850-a376da20d7f3@metafoo.de> <99ce1244-6646-6292-2c50-151819b01cfa@metafoo.de> <20180221130241.GI8334@sirena.org.uk> From: Fabio Estevam Date: Wed, 21 Feb 2018 10:43:27 -0300 Message-ID: To: Mark Brown Cc: Nicolin Chen , alsa-devel@alsa-project.org, Lars-Peter Clausen , Kuninori Morimoto Subject: Re: [alsa-devel] ASoC: Failed to create component debugfs directory 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 Hi Mark, On Wed, Feb 21, 2018 at 10:02 AM, Mark Brown wrote: > It's a legit warning - we shouldn't really be creating two components > for the same device. However this is a bit of a corner case as it's the > dmaengine platform driver which is kind of a virtual device, it's not > really the device that we use with DMA that's being represented but > rather the link between that and the DMA controller. > > Does the below patch (completely untested) help here? It adds a prefix > to the name for deduplication. > > diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c > index d53786498b61..d5a6eea64036 100644 > --- a/sound/soc/soc-generic-dmaengine-pcm.c > +++ b/sound/soc/soc-generic-dmaengine-pcm.c > @@ -431,6 +431,7 @@ int snd_dmaengine_pcm_register(struct device *dev, > if (!pcm) > return -ENOMEM; > > + pcm->platform.component.name_prefix = "dma"; Had to change it to pcm->component.name_prefix = "dma"; but still see the warnings. Here are the suggested change plus some additional debug lines: and the log looks like this: [ 2.062294] sgtl5000 1-000a: sgtl5000 revision 0x11 [ 2.069367] sgtl5000 1-000a: Using internal LDO instead of VDDD: check ER1 erratum [ 2.113827] fsl-asoc-card sound: ASoC: CPU DAI (null) not registered [ 2.123954] fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW [ 2.326451] [drm] Cannot find any crtc or sizes [ 2.501744] ************** component name is 2028000.ssi [ 2.507217] fsl-ssi-dai 2028000.ssi: ASoC: Succeded to create component debugfs directory [ 2.515429] ************** component name is sgtl5000.1-000a [ 2.521194] sgtl5000 1-000a: ASoC: Succeded to create component debugfs directory [ 2.544264] ************** component name is 2028000.ssi [ 2.549879] fsl-ssi-dai 2028000.ssi: ASoC: Failed to create component debugfs directory [ 2.565605] imx-sgtl5000 sound: sgtl5000 <-> 2028000.ssi mapping ok [ 2.584074] ************** component name is 2004000.spdif [ 2.589721] fsl-spdif-dai 2004000.spdif: ASoC: Succeded to create component debugfs directory [ 2.598437] ************** component name is 2004000.spdif [ 2.603978] fsl-spdif-dai 2004000.spdif: ASoC: Failed to create component debugfs directory [ 2.616340] imx-spdif sound-spdif: snd-soc-dummy-dai <-> 2004000.spdif mapping ok Looks like the 'dma' prefix did not take effect, as we are still trying to register the same name twice. Thanks --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -303,6 +303,8 @@ static void soc_init_component_debugfs(struct snd_soc_component *component) if (!component->card->debugfs_card_root) return; + pr_err("************** component name is %s\n", component->name); + if (component->debugfs_prefix) { char *name; @@ -318,6 +320,12 @@ static void soc_init_component_debugfs(struct snd_soc_component *component) component->card->debugfs_card_root); } + if (component->debugfs_root) { + dev_warn(component->dev, + "ASoC: Succeded to create component debugfs directory\n"); + return; + } + if (!component->debugfs_root) { dev_warn(component->dev, "ASoC: Failed to create component debugfs directory\n"); diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index c07d5c7..16995dd 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -442,6 +442,7 @@ int snd_dmaengine_pcm_register(struct device *dev, if (!pcm) return -ENOMEM; + pcm->component.name_prefix = "dma"; pcm->config = config; pcm->flags = flags;