Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp943061pxb; Wed, 6 Apr 2022 04:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpEUTbqCGSFeWX2uI/e/VWuFcXliacCOxznHdvZixx0ACKwtTScaHGFfsvj/XMa9lIaRRN X-Received: by 2002:a17:902:cec9:b0:156:8e7a:bf4e with SMTP id d9-20020a170902cec900b001568e7abf4emr8294241plg.62.1649246386733; Wed, 06 Apr 2022 04:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246386; cv=none; d=google.com; s=arc-20160816; b=O46xnjdTwJDJ80EYPP5OSBB0vMgsMb2wlu6vQKMIuafk6qaqe81lTVwW95U/t/BwL0 7IUd3lB7Akbxv3xKn6Ujvs/a1fYjEn77iDdmYx7hRSo2kt4rqMLThXUdIMyf2o+YC+6R Xkmjan2y9qy+AK/7Dxs71GEsYPnyAliQXpdgTeRalXIAwH20beIo3M13q/ziIwev8z42 1Z6zBy2f0t45dabMSFwtZfEHMantLOtujaHTLq9NiXBMlxuGZRfmGLUpH5OSgvL4zV1v fkQglkegT2LkGxlKWziT0JYM16AilFWIFlU3YNWzxViYRRO1uwcva40YTZR/6wOw9KXc dLVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=47hQAlVAcuVrSSaRPrj7poap176+z97EoYfZvN5CJnU=; b=u9XjiIq8QxIYB9yzO6gRjRD0vDbau9qpV7PZ923hLPbuvzyQJTRBOFWhHSKLm4Rnak EoyfahIzRzLUAwJ1RMoXP8NGy52tbvyPEME+KeqBwMEKuYT8I96fPUm8l3cdgVn1ieFN nfhuW6JerlgUE4qMRlRIbuiqIp99c6ESVvEf4dLMt9rv/X9XHc9E11pzmkYcE/xTpBs1 qJ35KajHHil5NdpsTxfLrkoN87sVLBiWeQgVyHtTpKCCEfCIn8YiXNDSY7dCDGEiozwN wh9AE1xq2TVcbrD6ckSClrGzk1y88nmm9pyrGC1I/B/7GJK5wTO06q8W3DhnXXyTIeeR B+OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sNRDXYTT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p22-20020a056a000b5600b004fab35f2191si16891385pfo.194.2022.04.06.04.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sNRDXYTT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE9BE1557C0; Wed, 6 Apr 2022 03:22:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580320AbiDEXeK (ORCPT + 99 others); Tue, 5 Apr 2022 19:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351542AbiDEKCi (ORCPT ); Tue, 5 Apr 2022 06:02:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 530E5710D2; Tue, 5 Apr 2022 02:51:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C8F2461368; Tue, 5 Apr 2022 09:51:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D299DC385A1; Tue, 5 Apr 2022 09:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152315; bh=73n2kpjKjVfcEIGK9ACsjcNs/FDx2rkxpRD6WZBYkQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sNRDXYTTx2P7A4IUrN5kT/5yEXyzkfJNRyyvkIlbqIYCeB7iXNzhqpZAgj5GjdfjP oi4KztCFtrgZElEj5kN1gxJAsFABYWqZa2gskPxJs2fH9E7rftXCI9gb+CxcentpZs 6VG17NSBcsV4R3Q1l00wKQKOpj6J+FyzbM3bhA0k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Reddy Muralidhar , Ranjani Sridharan , Rander Wang , Bard Liao , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.15 731/913] ASoC: SOF: Intel: match sdw version on link_slaves_found Date: Tue, 5 Apr 2022 09:29:53 +0200 Message-Id: <20220405070401.743093014@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Bard Liao [ Upstream commit f67c0c0d3b9048d86ea6ae52e36a2b78c48f265d ] Codecs with the same part id, manufacturer id and part id, but different sdw version should be treated as different codecs. For example, rt711 and rt711-sdca are different. So, we should match sdw version as well. Reported-by: Reddy Muralidhar Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220120232157.199919-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/intel/hda.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index ef92cca7ae01..ddf70902e53c 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1072,7 +1072,7 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, struct hdac_bus *bus = sof_to_bus(sdev); struct sdw_intel_slave_id *ids = sdw->ids; int num_slaves = sdw->num_slaves; - unsigned int part_id, link_id, unique_id, mfg_id; + unsigned int part_id, link_id, unique_id, mfg_id, version; int i, j, k; for (i = 0; i < link->num_adr; i++) { @@ -1082,12 +1082,14 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, mfg_id = SDW_MFG_ID(adr); part_id = SDW_PART_ID(adr); link_id = SDW_DISCO_LINK_ID(adr); + version = SDW_VERSION(adr); for (j = 0; j < num_slaves; j++) { /* find out how many identical parts were reported on that link */ if (ids[j].link_id == link_id && ids[j].id.part_id == part_id && - ids[j].id.mfg_id == mfg_id) + ids[j].id.mfg_id == mfg_id && + ids[j].id.sdw_version == version) reported_part_count++; } @@ -1096,21 +1098,24 @@ static bool link_slaves_found(struct snd_sof_dev *sdev, if (ids[j].link_id != link_id || ids[j].id.part_id != part_id || - ids[j].id.mfg_id != mfg_id) + ids[j].id.mfg_id != mfg_id || + ids[j].id.sdw_version != version) continue; /* find out how many identical parts are expected */ for (k = 0; k < link->num_adr; k++) { u64 adr2 = link->adr_d[k].adr; - unsigned int part_id2, link_id2, mfg_id2; + unsigned int part_id2, link_id2, mfg_id2, version2; mfg_id2 = SDW_MFG_ID(adr2); part_id2 = SDW_PART_ID(adr2); link_id2 = SDW_DISCO_LINK_ID(adr2); + version2 = SDW_VERSION(adr2); if (link_id2 == link_id && part_id2 == part_id && - mfg_id2 == mfg_id) + mfg_id2 == mfg_id && + version2 == version) expected_part_count++; } -- 2.34.1