Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2212159pxb; Wed, 30 Mar 2022 19:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylZCGKeJVaUbLxvv6wZH7P9Uwh2ZG8xyLz11l9CXOE54aUKfQaiQkWTpubHKJiRFrfHODQ X-Received: by 2002:a63:7d02:0:b0:398:9594:63f4 with SMTP id y2-20020a637d02000000b00398959463f4mr7721450pgc.375.1648693789491; Wed, 30 Mar 2022 19:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648693789; cv=none; d=google.com; s=arc-20160816; b=B44D6O6nY3l6/JhZjYp+Zxt9A3eqQaQ70Lj4WT4MCF37+TR8mWi5wvFgvOW79gWRzl J19g9eg0/j5irrTbuFrzi4zV8qN0P6dBCIkPObppUm+ji9NDO5pJoZWkt4glDuyoNVML k6d1wfY7l3YjgUz4jlDkiNAFv13Vfh2b0Zr+Vx/9TvUq9+66Mv9SAn8XaaiBZtY/i3ce xYT+mYr4SYtCDT3OGhAaew27KAcc2gGxGSeATSR471s2va32e+eCQ2f7Up5k+32SVa/e tyMIt/0MPB9mDjoJw1o8k4AyKg/Zi98hCX8QWuUnyUanAu2UqdOrSOAnYCM/ZjSs4Lm3 vdPg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3kY+YhA2bgH1GuYL/+kr9UregCEk7ct6MF66lCbpKsQ=; b=iQAKbQXyN3lQlrGlkvP7CHvFA/5tObDLf3uZr+dDsZpBHuQQ4Tn8TthS909uRUyL40 M8gOTyPFNd7JcoQZOppdiKxE/3bn7yFTDLRLcGvvECxMMbW4y/YIiO/d1eo1j5dDtAkn VcaFqJyO0ZDA7iTF55JMryxoa0UNV4+XSsJQglKIBKWB/tC4iYy68Jat6MGiGZYO5bAD 5k4Xts9HnMIESxKO02910xCrzOmp4PRGgHTMIgqTm2JpLuNB6yjJ4lAgk+o5gOvJUmii ++yaUxOThE/zjme9FR9BZBy6G3Qy3Q9JE69kPxlYb0BHPOmdqP9UzjJCH30mtH1o5ynX 76mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X+Pc8kSf; 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=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c9-20020a170902724900b00153b2d16513si20977916pll.283.2022.03.30.19.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:29:49 -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=@kernel.org header.s=k20201202 header.b=X+Pc8kSf; 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=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2313F710E4; Wed, 30 Mar 2022 19:27:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345138AbiC3L6I (ORCPT + 99 others); Wed, 30 Mar 2022 07:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344369AbiC3LxD (ORCPT ); Wed, 30 Mar 2022 07:53:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963CE26132E; Wed, 30 Mar 2022 04:48:46 -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 E0C01615E7; Wed, 30 Mar 2022 11:48:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06922C36AE3; Wed, 30 Mar 2022 11:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640925; bh=qMSq2ZM7H+t3XIYKOQd73sqX230ds6e20YdaLYU4CE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X+Pc8kSfrsdtamEMikiNN2EfvAQ84TM2JNc+39J28G1kzot6loz236yEm+bKiGy/n I3GyZJIyqXkjzjUkMOcOcT4RhPiJS3+OdZDn50tjW7zKqSQ7nTrqf0edMMi/TlJK/u PMy8TQm9qWsSD9xMBAL5U8thzJnXM8vZU6d4bjD8IrwnjsI2o1zR+cVMKv+8a8iNNR 6V+rtMvRW9BrlDYUb5dlGu5lls5BBDZmJEx2vAm5W4ec9gUhoLFtq7S6HNeBvdorT7 91oc7GG+UsMhIMgRfhEvF1SOAF9HKhadcxAzetbBkH6MVt1HvdRZHdaI1dfsyqpRQH OtWpR2v03x0LQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bard Liao , Reddy Muralidhar , Ranjani Sridharan , Rander Wang , Pierre-Louis Bossart , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.16 08/59] ASoC: SOF: Intel: match sdw version on link_slaves_found Date: Wed, 30 Mar 2022 07:47:40 -0400 Message-Id: <20220330114831.1670235-8-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 25200a0e1dc9..fc88296ab898 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1200,7 +1200,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++) { @@ -1210,12 +1210,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++; } @@ -1224,21 +1226,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