Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2595186rdb; Wed, 4 Oct 2023 06:12:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIBzEKaH2bBgRh3U5Yim/2ZIMQipzt8REKj0fngKq/XdDPve5wvh9IeU8DDHd//hBMXpry X-Received: by 2002:a05:6a00:1310:b0:68e:2c2a:5172 with SMTP id j16-20020a056a00131000b0068e2c2a5172mr3230590pfu.6.1696425126702; Wed, 04 Oct 2023 06:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696425126; cv=none; d=google.com; s=arc-20160816; b=pQoV0a+HGjieYWFyXXUTUdhqiG4xp/ZO0rxzJcA0VN+4kWpgencfJDf3O3K7UKGpAL 9sjLL2+u++AWn0YfmywjeGxgZ6Si6BJH2Ys7l7GMFKoTz7fzLaqkuo2OXRftv9xj54wt FCKtl0aFYU5yN0DRcHwnZDnJi+UDTO8Al/W1XhC2XztX1wkQhezzDcNkpf70JZVHj8Eu VQt9UqQAwbZxveQ4o2Wfgzn3w55vXN7fiR3Zsm/WDiz03k+P8dzsuWmdmTFeAgGqmDk4 T3vdrhwTUT9rUA2Su5WdsTwVBS+j9nYfGL19+Vy5GYnJy/UnURaMU4yaam9j2d4LpYUL c9Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aqFYsS8tFsUwVD7Jf+dw3AJ28l7TrvLQdlnM7yMmCpY=; fh=IE6S/Q8PpQS5ch9WOtXkLTsEU+Mr0HHjxEbbcH78BJU=; b=mbaMbHwRR8vn+Q+byR0f/fOjbOKW/qoVKDMHX9L9Yz2QvAAFSajY9sPweQqvr4yBGu DlyDiXl7JsX2aJNt2YU/LR2BNFGWFtfxudjc1+8HURsU7jqZrOqD6fjTXHAipMisux77 Ux8wMBQe/AAFwJNak8G2RuTLOAM8M14KX8pr8NS9KdUP7MpX0Y819DlgJXy/kvq0sCPF /T3+wo6ijsscj5lZr+bFRlx9WJAlzkiUMPUZmsVt9OJfa5htHRiN9qDdE9WrL7N8pZA3 K2OQBss0obYR93RN2FBrTy9POEAL8qOpniJARpweAtrs7SA//v53FkUSz4OuJKcdc1tz GjEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LFq47Bav; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h7-20020a056a00230700b0068beee4922csi3833875pfh.23.2023.10.04.06.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 06:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LFq47Bav; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BD9DB80622B9; Wed, 4 Oct 2023 06:11:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242556AbjJDNLv (ORCPT + 99 others); Wed, 4 Oct 2023 09:11:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233003AbjJDNLu (ORCPT ); Wed, 4 Oct 2023 09:11:50 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB1B98; Wed, 4 Oct 2023 06:11:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E438BC433C7; Wed, 4 Oct 2023 13:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696425107; bh=siX93/m9hk1N1zT9g0DoJx25MsV21pxMygnh0PRczAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LFq47BavBbfGaR+VlduyVs/WF3d+Fqa/zzazKNmOrkvelOde1Ggdug0fAZUEcQzt8 6WW/anpby0kWPROJLOkeLV8dxT3IZTmLpFYHxaHqGOmLLieiKebPbvzm0wlKPOnWG0 vA15t9OEHnNVNmFRWknBjy4wUIP04rLg7oqnFnls= Date: Wed, 4 Oct 2023 15:11:44 +0200 From: Greg Kroah-Hartman To: Krzysztof Kozlowski Cc: Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Philippe Ombredanne , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] soundwire: fix initializing sysfs for same devices on different buses Message-ID: <2023100426-purebred-cabbie-ae19@gregkh> References: <20231004130243.493617-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004130243.493617-1-krzysztof.kozlowski@linaro.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 06:11:51 -0700 (PDT) On Wed, Oct 04, 2023 at 03:02:43PM +0200, 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: > > 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, Shouldn't some documenation also be changed somewhere that describes the device id? thanks, greg k-h