Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2598957rdb; Wed, 4 Oct 2023 06:17:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJd3PX+hxzv8pOAT+xUaStKvb3eKQpIVb0azTpQsnbfE4Y94magTtT/j1f7YmDwjuw3ltl X-Received: by 2002:a17:903:441:b0:1b0:3ab6:5140 with SMTP id iw1-20020a170903044100b001b03ab65140mr2942131plb.4.1696425449827; Wed, 04 Oct 2023 06:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696425449; cv=none; d=google.com; s=arc-20160816; b=xJaDnbeoetVVFbmEXKCkTOfSUHFdWG585IQppqLt0nAXsgihNC9g+X3PvJcdsdNMWQ lIIV8p4wRbYQa0jFd58zqTogJ6EvjcXo8OpkYTTRAFEzrbhdrYUl9k6lDMkXnn8d1Ymf fdDqIZQ6K+EEFuy/XBrdry3jSPjUkPvETECKl1zAK1yHjcn77XB25zndvcmmlfFZJtig +nKkeIk3SX7dZPjZ0qVCgXRdDEiYidBZeoX8crS/HOWdrDndRAGfl50qu/1Ue8AwPi0s oMir/Q8cOe7S9qVRLIoPs+cXqVONVUX7qlspg3Fp1SYZ3nB0kUUT4+yiquspcEBAUDr4 cBMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=LbJfBqxykg9d7tVZjs3AWJuuHka9+ruVIn6aXhieUrI=; fh=w46db5AXIit6jNKDYGD7W5VjjVg54a/1e9mqN6l9TrU=; b=CDqaWKpmUX6YlxKKTG61BWsiGAK70Igky6iJDIy5jT4eJ6IdmQ5quPZcHuk79blHmc rKMhV489D6z24GTN/bvNSs93NNWrHnpNulatYkFR5fxTIVIGlaZ+m8e9OvPVe6PS2mkA CCoqKhPxdeGxcF6LnU87xIypCWvDL0LI6NzOzc3b+m2QlVBX+O9aTfb3Foahuy8WX0/w 5IavUEA3/wzrre0WD4RS3jCj3AJkF/S3idAC2VTVOoowkQgH4R/QFjkGPq5T4DiuFK4J l/z2poqTHHxXE1owOx67pGRXnRDNthUMai6L8yH8SRUxaEWcyWVSIzOJN5MWwZLITLg8 E48g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhcgB74g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f13-20020a170903104d00b001c60c109ce7si3404468plc.295.2023.10.04.06.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 06:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhcgB74g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AA3948266583; Wed, 4 Oct 2023 06:17:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242570AbjJDNQ6 (ORCPT + 99 others); Wed, 4 Oct 2023 09:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242568AbjJDNQ5 (ORCPT ); Wed, 4 Oct 2023 09:16:57 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88BDFE4; Wed, 4 Oct 2023 06:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696425410; x=1727961410; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=J7FWRujScPWtK9aYMSMLSqxeUcL9YGPo2NYKLZhT1DU=; b=ZhcgB74gh0utddU/FTDvguZr1Am7Hm2j4lIiKjP193R46WU9YH/fvK3I IXzy2RbqOiK9GclYtuuRaZlFqLRYWPqfZ8M41/ob2VG1fB8/mw6tM8LfQ xsTfDJDWgH66zYLPLRRpDB6TyeqCAss7VGJjw2tQUNEDAEItcMRPdiI98 Ti9BIbB3d0Ah8LetRbJ+nXCe1rQvof8vgjtzym1UyABUjwZY6HLeQWRiF NDhw0ORJdWhP8fPi9gSMxAMai5Q6gXI2Pueqk6Bq+LDoDoDu8tUlGQVnW WmSg5Zu5nZ7RcPGcgLGhTUQcXOj/a3MOWxk2ntuqJKDklint56qQzqktF g==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="383069838" X-IronPort-AV: E=Sophos;i="6.03,200,1694761200"; d="scan'208";a="383069838" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 06:16:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="821664266" X-IronPort-AV: E=Sophos;i="6.03,200,1694761200"; d="scan'208";a="821664266" Received: from mfmousa-mobl1.amr.corp.intel.com (HELO [10.212.98.56]) ([10.212.98.56]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 06:16:48 -0700 Message-ID: <6628a5f6-ed22-4039-b5c2-2301c05c7e3e@linux.intel.com> Date: Wed, 4 Oct 2023 09:16:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] soundwire: fix initializing sysfs for same devices on different buses Content-Language: en-US To: Krzysztof Kozlowski , Vinod Koul , Bard Liao , Sanyog Kale , Greg Kroah-Hartman , Philippe Ombredanne , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org References: <20231004130243.493617-1-krzysztof.kozlowski@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <20231004130243.493617-1-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 06:17:19 -0700 (PDT) On 10/4/23 09:02, Krzysztof Kozlowski wrote: > If same devices with same device IDs are present on different soundwire > buses, the probe fails due to conflicting device names and sysfs > entries: > > sysfs: cannot create duplicate filename '/bus/soundwire/devices/sdw:0:0217:0204:00:0' > > The link ID is 0 for both devices, so they should be differentiated by > bus ID. Add the bus ID so, the device names and sysfs entries look > like: I am pretty sure this will break Intel platforms by changing the device names. sof_sdw.c: else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, sof_sdw.c: "sdw:%01x:%04x:%04x:%02x", link_id, sof_sdw.c: "sdw:%01x:%04x:%04x:%02x:%01x", link_id, > > sdw:1:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6ab0000.soundwire-controller/sdw-master-1/sdw:1:0:0217:0204:00:0 > sdw:3:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6b10000.soundwire-controller/sdw-master-3/sdw:3:0:0217:0204:00:0 > > Fixes: 7c3cd189b86d ("soundwire: Add Master registration") > Cc: > Signed-off-by: Krzysztof Kozlowski > > --- > > Sending as RFT, because I did not test it on that many devices and > user-spaces. > --- > drivers/soundwire/slave.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c > index c1c1a2ac293a..4db43ea53d47 100644 > --- a/drivers/soundwire/slave.c > +++ b/drivers/soundwire/slave.c > @@ -39,14 +39,14 @@ int sdw_slave_add(struct sdw_bus *bus, > slave->dev.fwnode = fwnode; > > if (id->unique_id == SDW_IGNORED_UNIQUE_ID) { > - /* name shall be sdw:link:mfg:part:class */ > - dev_set_name(&slave->dev, "sdw:%01x:%04x:%04x:%02x", > - bus->link_id, id->mfg_id, id->part_id, > + /* name shall be sdw:bus:link:mfg:part:class */ > + dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x", > + bus->id, bus->link_id, id->mfg_id, id->part_id, > id->class_id); > } else { > - /* name shall be sdw:link:mfg:part:class:unique */ > - dev_set_name(&slave->dev, "sdw:%01x:%04x:%04x:%02x:%01x", > - bus->link_id, id->mfg_id, id->part_id, > + /* name shall be sdw:bus:link:mfg:part:class:unique */ > + dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x:%01x", > + bus->id, bus->link_id, id->mfg_id, id->part_id, > id->class_id, id->unique_id); > } >