This is a note to let you know that I've just added the patch titled soundwire: fix initializing sysfs for same devices on different buses to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: soundwire-fix-initializing-sysfs-for-same-devices-on-different-buses.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8a8a9ac8a4972ee69d3dd3d1ae43963ae39cee18 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Date: Tue, 17 Oct 2023 11:09:33 -0500 Subject: soundwire: fix initializing sysfs for same devices on different buses From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> commit 8a8a9ac8a4972ee69d3dd3d1ae43963ae39cee18 upstream. 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 the controller ID. Add the controller 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-0/sdw:1:0:0217:0204:00:0 sdw:3:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6b10000.soundwire-controller/sdw-master-3-0/sdw:3:0:0217:0204:00:0 [PLB changes: use bus->controller_id instead of bus->id] Fixes: 7c3cd189b86d ("soundwire: Add Master registration") Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx> Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Acked-by: Mark Brown <broonie@xxxxxxxxxx> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Link: https://lore.kernel.org/r/20231017160933.12624-3-pierre-louis.bossart@xxxxxxxxxxxxxxx Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/soundwire/slave.c | 12 ++++++------ sound/soc/intel/boards/sof_sdw.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) --- 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:ctrl:link:mfg:part:class */ + dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x", + bus->controller_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:ctrl:link:mfg:part:class:unique */ + dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x:%01x", + bus->controller_id, bus->link_id, id->mfg_id, id->part_id, id->class_id, id->unique_id); } --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1197,11 +1197,11 @@ static int fill_sdw_codec_dlc(struct dev else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, class_id, adr_index)) codec->name = devm_kasprintf(dev, GFP_KERNEL, - "sdw:%01x:%04x:%04x:%02x", link_id, + "sdw:0:%01x:%04x:%04x:%02x", link_id, mfg_id, part_id, class_id); else codec->name = devm_kasprintf(dev, GFP_KERNEL, - "sdw:%01x:%04x:%04x:%02x:%01x", link_id, + "sdw:0:%01x:%04x:%04x:%02x:%01x", link_id, mfg_id, part_id, class_id, unique_id); if (!codec->name) Patches currently in stable-queue which might be from krzysztof.kozlowski@xxxxxxxxxx are queue-6.6/pwm-jz4740-don-t-use-dev_err_probe-in-.request.patch queue-6.6/arm-dts-qcom-sdx65-correct-pcie-ep-phy-names.patch queue-6.6/arm64-dts-qcom-sm8550-correct-tx-soundwire-clock.patch queue-6.6/arm64-dts-qcom-sm6125-add-interrupts-to-dwc3-usb-con.patch queue-6.6/dt-bindings-clock-update-the-videocc-resets-for-sm81.patch queue-6.6/arm-dts-qcom-sdx65-correct-spmi-node-name.patch queue-6.6/arm64-dts-qcom-sdm845-db845c-correct-led-panic-indic.patch queue-6.6/arm64-dts-qcom-sm8450-correct-tx-soundwire-clock.patch queue-6.6/dt-bindings-arm-qcom-fix-html-link.patch queue-6.6/soundwire-fix-initializing-sysfs-for-same-devices-on-different-buses.patch queue-6.6/arm64-dts-qcom-qrb5165-rb5-correct-led-panic-indicat.patch queue-6.6/arm-dts-qcom-apq8064-correct-xoadc-register-address.patch queue-6.6/dt-bindings-phy-qcom-sc8280xp-qmp-usb43dp-phy-fix-path-to-header.patch