Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp704553pxb; Tue, 5 Apr 2022 19:32:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRZ07ZkudeBahUYV/si6t9cnMW8J1zPtNGJWbe6WN7bWY0UE185gItvJv30EVU26Hsbypx X-Received: by 2002:a63:d44c:0:b0:380:8c48:e040 with SMTP id i12-20020a63d44c000000b003808c48e040mr5453524pgj.14.1649212373416; Tue, 05 Apr 2022 19:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212373; cv=none; d=google.com; s=arc-20160816; b=TgxMqaAXPi3sv0JgVttRxjBYalSRadY5+o2auPuhSFcrm+M2tR11hINWZtbWB/ThQP QOZW3pkImCTzGmBElf3Am7y+N21Gn8o3X6J8ZXf5P/HmSIwjxc4TEhR0AIN2IM5fy/1Z pFrsb3XeJV2TrX12MQ8RE+UVPxXctg28+O+x2/0bIPImb5cuNZcB+1TqLikrsyEnfDQp EFHbaHFrm9NZj8rYsF1Ejzv6sx4549tUJZlfThImNfdHL+MByMuUwYxw4JKClv5p9dOw Iusj+Dnlie7/1YVTaDmClEDW7s8Pg650/MSW39SJ8oKt8PkDaMSoklaGju7DG5lphksX auhQ== 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=vMHcGPfXUVWhsxZxnXLDbIDxQkuURfVggqZ4G/FbA74=; b=Ssb2d+g5xGnFI96nBcrpseplqyWNkIvDsj6lFmN9LhVWAH6Y6soBu2xt83gkhIXqUw LPrJCGxuX8tgZAF57lGApajlkMYOVV0CGbb4a+toBw6oHRud4qCig2aSAjptwKZ1ni45 /AJZkSO+mOr+B4Yrnrr9gGrUlnPjHqLDFA0YPq6kRDSpj/vytPqweBSi7Iv2TujWeFox MeLSVFkl9kFGT1SU8i/d2S2BuSGBck43qB0L9yRIfCoVPz588Lx6Au1RMBANUhTLzCKI nWKf7iGqmnuCEbWzKJne7As8CIwindJDEjgAMHun+ENgVIEfzcEZJSwFYbvEgWFCDCtc pgjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GAr1qwiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a170902edca00b00153b2d1663csi9114285plk.580.2022.04.05.19.32.38; Tue, 05 Apr 2022 19:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GAr1qwiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344460AbiDEKjw (ORCPT + 99 others); Tue, 5 Apr 2022 06:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbiDEIYg (ORCPT ); Tue, 5 Apr 2022 04:24:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C56E12753; Tue, 5 Apr 2022 01:20:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4B1A6B81BB0; Tue, 5 Apr 2022 08:20:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC59BC385A1; Tue, 5 Apr 2022 08:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146806; bh=a+hYV3dWe1oVsX+cvNgh7RLaS51GSRre3hs0wbTB+k0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAr1qwiOt4MUhXQZLdDYOMfmr4CqQqVw38OytPPEVtLi65u96WkKuoO44bLzv2vr1 y+ZHqM6mjHH7BBOvo6qInTzGFwOkrTAlBxakzs/fJ8pQnmdvtuJy5zLP2vlHzZXq6p GkhG+CPVKcHW/pYZs/CBe9/LS2bK+odSLSmZq2dM= 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.17 0896/1126] ASoC: SOF: Intel: match sdw version on link_slaves_found Date: Tue, 5 Apr 2022 09:27:23 +0200 Message-Id: <20220405070433.822977108@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 1385695d7745..848d1d563170 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1188,7 +1188,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++) { @@ -1198,12 +1198,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++; } @@ -1212,21 +1214,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