From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3228DC433F5 for ; Tue, 7 Sep 2021 16:11:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3118F60555 for ; Tue, 7 Sep 2021 16:11:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3118F60555 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B22F81721; Tue, 7 Sep 2021 18:10:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B22F81721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1631031082; bh=jCYNu7sJ2U5I119M6nyq2w0oYbUApNFCJcb/UZ+P9H8=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VpUtxyotaqAfUJyJ4rDpuigctVUVTz85quW2kwkMQTnWF1/gx+Y/sYf7zur7G+bbQ z3GA8TyEZTh1wBA8fbgk8VccOse/M3RY7M64n6lbXpGxLJp3nbqAxg96MvBw+Ibd8z ISSumj1vtwEyLLaIcEBAA/wSnAJU77QJ+verN38c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5177F804F1; Tue, 7 Sep 2021 18:09:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6379F804F2; Tue, 7 Sep 2021 18:09:21 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1FC75F802A9 for ; Tue, 7 Sep 2021 18:09:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1FC75F802A9 X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="217081449" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="217081449" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 09:06:13 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="512893461" Received: from mrburno-mobl.amr.corp.intel.com (HELO [10.212.10.81]) ([10.212.10.81]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 09:06:12 -0700 Subject: Re: [PATCH v2] soundwire: debugfs: use controller id and link_id for debugfs To: Srinivas Kandagatla , vkoul@kernel.org, yung-chuan.liao@linux.intel.com References: <20210907105332.1257-1-srinivas.kandagatla@linaro.org> From: Pierre-Louis Bossart Message-ID: <53297f34-2353-868d-617b-d9339223799c@linux.intel.com> Date: Tue, 7 Sep 2021 10:44:31 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210907105332.1257-1-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: sanyog.r.kale@intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On 9/7/21 5:53 AM, Srinivas Kandagatla wrote: > link_id can be zero and if we have multiple controller instances > in a system like Qualcomm debugfs will end-up with duplicate namespace > resulting in incorrect debugfs entries. > > Using bus-id and link-id combination should give a unique debugfs directory > entry and should fix below warning too. > "debugfs: Directory 'master-0' with parent 'soundwire' already present!" > > Fixes: bf03473d5bcc ("soundwire: add debugfs support") > Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart > --- > Changes since v1: > Added Link ID along with bus id. > > drivers/soundwire/debugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c > index b6cad0d59b7b..49900cd207bc 100644 > --- a/drivers/soundwire/debugfs.c > +++ b/drivers/soundwire/debugfs.c > @@ -19,7 +19,7 @@ void sdw_bus_debugfs_init(struct sdw_bus *bus) > return; > > /* create the debugfs master-N */ > - snprintf(name, sizeof(name), "master-%d", bus->link_id); > + snprintf(name, sizeof(name), "master-%d-%d", bus->id, bus->link_id); > bus->debugfs = debugfs_create_dir(name, sdw_debugfs_root); > } > >