From patchwork Fri May 19 20:17:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F41DC77B75 for ; Fri, 19 May 2023 12:18:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 86B66201; Fri, 19 May 2023 14:17:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 86B66201 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498678; bh=xKs0sKOFC8whl/yuyULPst15ZR2QkGZqx+W9OFp2gFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WnIyy1bacbF454lFJpNn7SM4HlDar+qd0Gtmz8MuF4Wi4qASZ+9x3ln5+S0Lod+SJ jUxC8TSQdzcVpyHqNVohfnXSLv1RWxanyfKDOYUQ4Df/6Sbz9ADSrmcgPl9kzQANVG KbBoh3wpt8q/ip2TOSts3CHWjhPetMCRx0q3R33E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1C984F8056F; Fri, 19 May 2023 14:16:11 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 81F04F8056F; Fri, 19 May 2023 14:16:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40020F80542; Fri, 19 May 2023 14:16:04 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C97E8F80272 for ; Fri, 19 May 2023 14:15:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C97E8F80272 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IJyshSvG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498561; x=1716034561; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xKs0sKOFC8whl/yuyULPst15ZR2QkGZqx+W9OFp2gFY=; b=IJyshSvGH/QHSQ9R1Hos+DAf+xq+JwbecKEoWp7nJovR/jZ9mPW5S7Ge ccRO2UHaiIF42RqCShPygXZtcFPWk3JgEmOicSyU1mbw0Kf1tkrJcVe0B 54wR/yspKOzvxT1v6iFyTNt5BS/FwzkCq9bEhkbZv6FUoSZw5vYcjlcXz XHORZYGUcRCBgedkYRIh+DK0m6TvPxatqw7f46F9fp2f2kaIRSgSlRyeG c8WxYtR1xwQT1STfybvGmszNi0B3i9ck4wNajcayIushmXRuZZD0usDZX YjXdpA5Gb1yKymLe5NHSnDR5Editqvn3f6ev74yfNsOD0jyCT8iA+Yzdc w==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584409" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584409" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:15:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283658" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283658" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:15:53 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 1/7] ASoC: Intel: avs: Fix module lookup Date: Fri, 19 May 2023 22:17:05 +0200 Message-Id: <20230519201711.4073845-2-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: KWKGA3CDASFKCZLDC2V2ROA3ERYTY4LA X-Message-ID-Hash: KWKGA3CDASFKCZLDC2V2ROA3ERYTY4LA X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When changing value of kcontrol, FW module to which data should be send needs to be found. Currently it is done in improper way, fix it. Change function name to indicate that it looks only for volume module. This allows to change volume during runtime, instead of only changing init value. Fixes: be2b81b519d7 ("ASoC: Intel: avs: Parse control tuples") Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/control.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/avs/control.c b/sound/soc/intel/avs/control.c index a8b14b784f8a..3dfa2e9816db 100644 --- a/sound/soc/intel/avs/control.c +++ b/sound/soc/intel/avs/control.c @@ -21,17 +21,25 @@ static struct avs_dev *avs_get_kcontrol_adev(struct snd_kcontrol *kcontrol) return to_avs_dev(w->dapm->component->dev); } -static struct avs_path_module *avs_get_kcontrol_module(struct avs_dev *adev, u32 id) +static struct avs_path_module *avs_get_volume_module(struct avs_dev *adev, u32 id) { struct avs_path *path; struct avs_path_pipeline *ppl; struct avs_path_module *mod; - list_for_each_entry(path, &adev->path_list, node) - list_for_each_entry(ppl, &path->ppl_list, node) - list_for_each_entry(mod, &ppl->mod_list, node) - if (mod->template->ctl_id && mod->template->ctl_id == id) + spin_lock(&adev->path_list_lock); + list_for_each_entry(path, &adev->path_list, node) { + list_for_each_entry(ppl, &path->ppl_list, node) { + list_for_each_entry(mod, &ppl->mod_list, node) { + if (guid_equal(&mod->template->cfg_ext->type, &AVS_PEAKVOL_MOD_UUID) + && mod->template->ctl_id == id) { + spin_unlock(&adev->path_list_lock); return mod; + } + } + } + } + spin_unlock(&adev->path_list_lock); return NULL; } @@ -49,7 +57,7 @@ int avs_control_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va /* prevent access to modules while path is being constructed */ mutex_lock(&adev->path_mutex); - active_module = avs_get_kcontrol_module(adev, ctl_data->id); + active_module = avs_get_volume_module(adev, ctl_data->id); if (active_module) { ret = avs_ipc_peakvol_get_volume(adev, active_module->module_id, active_module->instance_id, &dspvols, @@ -89,7 +97,7 @@ int avs_control_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va changed = 1; } - active_module = avs_get_kcontrol_module(adev, ctl_data->id); + active_module = avs_get_volume_module(adev, ctl_data->id); if (active_module) { dspvol.channel_id = AVS_ALL_CHANNELS_MASK; dspvol.target_volume = *volume; From patchwork Fri May 19 20:17:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6058C77B7F for ; Fri, 19 May 2023 12:17:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7F1CF3E8; Fri, 19 May 2023 14:16:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7F1CF3E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498667; bh=KLWKYCB/nHshPSwyWfJ/Ve6YZxIExZIJ6s1YfxN9jMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eUFDjlNocffOuVCiEUmy9R/lagadCzUA0FQhxPzB4DyVXNJgeRols4v1X3vsqXbcE 0hiJJKGb0GvZSOcnE+aLjSXc8ZVZmNB/3LBE6jUxrNmsCFE9jRlVJ+b0p9Pr8lvHiD 3rPcd8vxLNgqwxUjXIl3slRVeR1nAZARJuPY5Cpg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5AA5FF80552; Fri, 19 May 2023 14:16:08 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A69D3F80552; Fri, 19 May 2023 14:16:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6155F8053D; Fri, 19 May 2023 14:16:02 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B1D15F8016D for ; Fri, 19 May 2023 14:15:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B1D15F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WROC+LGg DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498560; x=1716034560; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KLWKYCB/nHshPSwyWfJ/Ve6YZxIExZIJ6s1YfxN9jMU=; b=WROC+LGg6Taqdqu2nbZuiFlx8o+fsVZtRxPhg/TJPBh2ZJdZxlOFqKwz 5ZsFl52bWGYpbCG+tA5eZoi/tNRAmYLMHinteHR5OVCt3tLckhdF/hHFv Tu15NhM31fx32nP9xPn2UmzNqI0SAnPG4B5wz3EDCGxVrX5FCVlTgQPoG g4DHZ9Ky6Mel4ON4YH5vkTFkCJknF6LjFWJCGHLmVohUeU86ufoOheA6+ Y2y+VdEN/bGtnBsc/F0dk1DkPBTmjnF1bYLps9EFIZhRXBHVzATJhisRw ZbXwBpLsGjQQJvKaUmx2IHZgIozGGp3ZXkPBzmIt/NKHTr76xZtfYbKXP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584416" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584416" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:15:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283666" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283666" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:15:55 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 2/7] ASoC: Intel: avs: Access path components under lock Date: Fri, 19 May 2023 22:17:06 +0200 Message-Id: <20230519201711.4073845-3-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: IVVRHHZJSC7O2ZKPZSSHJ4GW6RIHU2AD X-Message-ID-Hash: IVVRHHZJSC7O2ZKPZSSHJ4GW6RIHU2AD X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Path and its components should be accessed under lock to prevent problems with one thread modifying them while other tries to read. Fixes: c8c960c10971 ("ASoC: Intel: avs: APL-based platforms support") Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/apl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/apl.c b/sound/soc/intel/avs/apl.c index 02683dce277a..1860099c782a 100644 --- a/sound/soc/intel/avs/apl.c +++ b/sound/soc/intel/avs/apl.c @@ -169,6 +169,7 @@ static bool apl_lp_streaming(struct avs_dev *adev) { struct avs_path *path; + spin_lock(&adev->path_list_lock); /* Any gateway without buffer allocated in LP area disqualifies D0IX. */ list_for_each_entry(path, &adev->path_list, node) { struct avs_path_pipeline *ppl; @@ -188,11 +189,14 @@ static bool apl_lp_streaming(struct avs_dev *adev) if (cfg->copier.dma_type == INVALID_OBJECT_ID) continue; - if (!mod->gtw_attrs.lp_buffer_alloc) + if (!mod->gtw_attrs.lp_buffer_alloc) { + spin_unlock(&adev->path_list_lock); return false; + } } } } + spin_unlock(&adev->path_list_lock); return true; } From patchwork Fri May 19 20:17:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB71BC77B7F for ; Fri, 19 May 2023 12:18:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A6C6E827; Fri, 19 May 2023 14:17:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A6C6E827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498694; bh=dKM8/qjifAr/pAHw/mTEzaJ2EgQi1hYiS+/J/CVx7xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RyVNm99Zh5q+E7ADA1BHvITeHoDiAF26r9ZR5Y1SOwBE+GFq7w5u9nQFwzO0Nlho6 CqrNwUCyVKvR8aDrtNRHtv7DJy0AmNfiJ3WaKmDXZPk/RRXmdftAwkaHM2N6ZJssLg Oz2UgW9Q3ruxgAXC1k1oGrL228b0F+XJu0/OUtZo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C7FA6F80579; Fri, 19 May 2023 14:16:12 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 63050F80579; Fri, 19 May 2023 14:16:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 95AA5F80558; Fri, 19 May 2023 14:16:05 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 297B7F80087 for ; Fri, 19 May 2023 14:16:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 297B7F80087 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eucra285 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498562; x=1716034562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dKM8/qjifAr/pAHw/mTEzaJ2EgQi1hYiS+/J/CVx7xs=; b=eucra285IlK0q15+NyFqP/PETPqK+BFloncHPhnF3RuDwkCml8MvWNZD u+DnmnMKqgv78UOfha9bE8RUtm7wuMnl23UAVFsCompPYgTeT3HcaYrtl dYf/WTxpORqzg+Mmuk6tEWqFvF1rqDnI1HGoURRbFb0LQc0Xvzpmm1yYU Af5IPEUU69i+52H1rHz2wucFqZh9NQnvTyeJkyl+vsNKEWnrgVJWYOPQ+ YBat8AKsoL9dQTylorsU9JwHWPeikjZOkJ1kemawmrH2GNSbFNjTTbnkS Ho7fg4hlQEirtencKzheeBQCzAF5ElEBvbJSjJzzp53sjTxvJsywNFfKT g==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584427" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584427" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:15:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283671" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283671" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:15:57 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 3/7] ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg Date: Fri, 19 May 2023 22:17:07 +0200 Message-Id: <20230519201711.4073845-4-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 26DMUJ7QJASAA2AXAT33YIUQQTGQXZVZ X-Message-ID-Hash: 26DMUJ7QJASAA2AXAT33YIUQQTGQXZVZ X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Constant 'C4_CHANNEL' does not exist on the firmware side. Value 0xC is reserved for 'C7_1' instead. Fixes: 04afbbbb1cba ("ASoC: Intel: Skylake: Update the topology interface structure") Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- include/uapi/sound/skl-tplg-interface.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/sound/skl-tplg-interface.h b/include/uapi/sound/skl-tplg-interface.h index f29899b179a6..4bf9c4f9add8 100644 --- a/include/uapi/sound/skl-tplg-interface.h +++ b/include/uapi/sound/skl-tplg-interface.h @@ -66,7 +66,8 @@ enum skl_ch_cfg { SKL_CH_CFG_DUAL_MONO = 9, SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10, SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11, - SKL_CH_CFG_4_CHANNEL = 12, + SKL_CH_CFG_7_1 = 12, + SKL_CH_CFG_4_CHANNEL = SKL_CH_CFG_7_1, SKL_CH_CFG_INVALID }; From patchwork Fri May 19 20:17:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDB80C77B7F for ; Fri, 19 May 2023 12:18:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BBF12822; Fri, 19 May 2023 14:17:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBF12822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498717; bh=GnlcbuHN3eUB4vi5MH4ZwiwwbuNCRhLF1S/ytDw3KOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=I57zeDtQJ7CxsJjiRpoyzkmgeyHxN7b+uQknHA6NYDc7NnA49/8vlPV6TyD+b8WDN F7gdD4jxbB/70gN5RWZAQo3E2kyvBpwxHcJ6zhIwivskNhR+7D6hKTozEvJrlQaN+m xVPvm9krIhQCeTgzzyoetm/CDTAnsEYfdp3ty9/g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0C578F805AA; Fri, 19 May 2023 14:16:14 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 855BFF805A8; Fri, 19 May 2023 14:16:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4196FF80553; Fri, 19 May 2023 14:16:06 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 96877F802E8 for ; Fri, 19 May 2023 14:16:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 96877F802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Vo8ui6Px DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498562; x=1716034562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GnlcbuHN3eUB4vi5MH4ZwiwwbuNCRhLF1S/ytDw3KOc=; b=Vo8ui6PxZ/IUjgtm3lkPMat/xB16gzq1jV/RWJxoW1LVtMIhSV8wTgcJ ex7Hjme3wKMk67PHCk5nv5p2q4fASRHtfNY4qSc5a8o2O8n5wJ+ltc42m 4aqGEUgCC3VTNqoXdRvCiyxMJIKom2XUdqLuliJMmsWHKPKzcxqAAP29G V8J9wWQIAC9UPh7lXGxo38RwEyK1K2R7pbMS0BC4VtKRPN7HRw4oCTnea 9Qt5ouHqF6V/468pMBglYaR3IpuygAm3tiKMdijLbEIJX8eWO+A5MWQxw m8ZNlnA7llbx/xCl+XQiajVstPfgGClPSAqG1/fH1EDeHAFdtRkR2G9dk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584436" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584436" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:16:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283676" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283676" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:15:58 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 4/7] ASoC: Intel: avs: Fix declaration of enum avs_channel_config Date: Fri, 19 May 2023 22:17:08 +0200 Message-Id: <20230519201711.4073845-5-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: NZ3D3OC5RGLD4GIRJRTEG6W4LY3ZI7TB X-Message-ID-Hash: NZ3D3OC5RGLD4GIRJRTEG6W4LY3ZI7TB X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Constant 'C4_CHANNEL' does not exist on the firmware side. Value 0xC is reserved for 'C7_1' instead. Fixes: 580a5912d1fe ("ASoC: Intel: avs: Declare module configuration types") Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/messages.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/messages.h b/sound/soc/intel/avs/messages.h index d3b60ae7d743..7f23a304b4a9 100644 --- a/sound/soc/intel/avs/messages.h +++ b/sound/soc/intel/avs/messages.h @@ -619,7 +619,7 @@ enum avs_channel_config { AVS_CHANNEL_CONFIG_DUAL_MONO = 9, AVS_CHANNEL_CONFIG_I2S_DUAL_STEREO_0 = 10, AVS_CHANNEL_CONFIG_I2S_DUAL_STEREO_1 = 11, - AVS_CHANNEL_CONFIG_4_CHANNEL = 12, + AVS_CHANNEL_CONFIG_7_1 = 12, AVS_CHANNEL_CONFIG_INVALID }; From patchwork Fri May 19 20:17:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A031AC77B75 for ; Fri, 19 May 2023 12:19:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 70496207; Fri, 19 May 2023 14:18:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 70496207 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498744; bh=Qqs5W2fPQCWiJGucM67Bf5zbjwSe1FCt+SIU27aMxq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nsKsYo3RpOIeVx8LxwhpvkmwzxEek7EnNi0yhyppLkkMm1xaFvc/jp936Occ0WvST 9lrNCrKwy6H+8lma3Zd53nN3cMHneQLOK6RRpW5dVDfab9uZghI9ASoYTB1cSwttnD wAnDaxv34ejo1xjK6+6S+auvtgpOLgsDSu5nWD2o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14278F805C5; Fri, 19 May 2023 14:16:20 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 757F8F805AE; Fri, 19 May 2023 14:16:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 190CCF8056F; Fri, 19 May 2023 14:16:10 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 897B2F8025A for ; Fri, 19 May 2023 14:16:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 897B2F8025A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YNFwnhiC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498563; x=1716034563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qqs5W2fPQCWiJGucM67Bf5zbjwSe1FCt+SIU27aMxq0=; b=YNFwnhiC39uzlFM20qFMkqMxc+AK0VkgmVNVzYBxAx9RIpLQh8Jcr26Q ThXCUGbpwdRcg1qbTfHEqD+QcinTySTa0gNG9uk4zH5Hy0vNiFvX+Eys6 h54ApOAdXuKiEPQuX0Kv8J3GK8kzy2B7VJSI/GUEtyqU98rBPY3NKFJmg 5Zu/TWJvAgHiw2W8CBD1MzjSntlB7eIueRmLmg82hth1y/Jw2C8MWUpmi hbN4RSyOMlfsrf3tDas97faC/RUGUTKD7B3zjbrKK2qeUE2/Cc6vq1hsl grzdH4OdBl/m/s64LJeH2Xuuf7oklU1zg53u5SexIqR5TXs4jSVgr/9Mz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584449" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584449" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:16:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283687" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283687" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:16:00 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 5/7] ASoC: Intel: avs: Account for UID of ACPI device Date: Fri, 19 May 2023 22:17:09 +0200 Message-Id: <20230519201711.4073845-6-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 7FOA6ZNDEZX2MSMUNAOTB5C5BVUT45HU X-Message-ID-Hash: 7FOA6ZNDEZX2MSMUNAOTB5C5BVUT45HU X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Configurations with multiple codecs attached to the platform are supported but only if each from the set is different. Add new field representing the 'Unique ID' so that codecs that share Vendor and Part IDs can be differentiated and thus enabling support for such configurations. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- include/sound/soc-acpi.h | 1 + sound/soc/intel/avs/board_selection.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index b38fd25c5729..528279056b3a 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -170,6 +170,7 @@ struct snd_soc_acpi_link_adr { /* Descriptor for SST ASoC machine driver */ struct snd_soc_acpi_mach { u8 id[ACPI_ID_LEN]; + const char *uid; const struct snd_soc_acpi_codecs *comp_ids; const u32 link_mask; const struct snd_soc_acpi_link_adr *links; diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c index b2823c2107f7..60f8fb0bff95 100644 --- a/sound/soc/intel/avs/board_selection.c +++ b/sound/soc/intel/avs/board_selection.c @@ -443,7 +443,7 @@ static int avs_register_i2s_boards(struct avs_dev *adev) } for (mach = boards->machs; mach->id[0]; mach++) { - if (!acpi_dev_present(mach->id, NULL, -1)) + if (!acpi_dev_present(mach->id, mach->uid, -1)) continue; if (mach->machine_quirk) From patchwork Fri May 19 20:17:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35285C77B75 for ; Fri, 19 May 2023 12:18:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 29C5D200; Fri, 19 May 2023 14:17:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 29C5D200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498727; bh=u5Nahq9CX7GjjYoRTCKrr/zt3xwGYj72/z0XAbEL9xg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XhP8RZ3XTcm+kGrgIRoiHYxmphTRqf05T6m+UxD9SvYvAVZ5FEeeRWPMa9HmzvmdN aXWqOKaOmPPSCexZd14QzaYw8mAXgG6FZ6rhy0ytRH25eynltnNJFcExh/mV31RzQV Pi+hMXF7KlLhx/Wyq6H5Gk7ogpDjT3P4JQse7OZw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0CB3DF805B4; Fri, 19 May 2023 14:16:16 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8539EF805AC; Fri, 19 May 2023 14:16:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BBE97F8055B; Fri, 19 May 2023 14:16:08 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 82D9BF80548 for ; Fri, 19 May 2023 14:16:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82D9BF80548 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KwBo0vO8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498565; x=1716034565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u5Nahq9CX7GjjYoRTCKrr/zt3xwGYj72/z0XAbEL9xg=; b=KwBo0vO8KNX6V/6CUodGiKR0J7pIFzS1u4TIwdrK5sbVH+ksxJoTZQ4n seNjkmSecwKRV99LAf0E3EGXB0Db/PXh1XSHnebzYZzQMizUYHYTgGSw2 xjvlZAQ40tTd1+38ziCFUTmsGP/LNnmHqavZS/rknw+NNBGWKKXFRwQJ1 MS9CjUHrx6HuAZSC/kI+3F9FYcAD9KziH3TY7GIdtQv+ek6V45m33M92s RadZgKMWjr2FCV5vu9ObmQXmN9qZ8/N0CGuTguNHkqQuyl6NgIKrwza7j S8tNvf4Elu7SDoXX5dNDYNpPe/PnTPuMP1ama2+wjiCFvUCHwi37Q/Ekg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584459" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584459" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:16:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283702" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283702" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:16:02 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 6/7] ASoC: Intel: avs: Fix avs_path_module::instance_id size Date: Fri, 19 May 2023 22:17:10 +0200 Message-Id: <20230519201711.4073845-7-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: JSX74UE6X33ONN4I35VHHTBZP4G7VVRT X-Message-ID-Hash: JSX74UE6X33ONN4I35VHHTBZP4G7VVRT X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: All IPCs using instance_id use 8 bit value. Original commit used 16 bit value because FW reports possible max value in 16 bit field, but in practice FW limits the value to 8 bits. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/avs.h | 4 ++-- sound/soc/intel/avs/dsp.c | 4 ++-- sound/soc/intel/avs/path.h | 2 +- sound/soc/intel/avs/probes.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h index d7fccdcb9c16..0cf38c9e768e 100644 --- a/sound/soc/intel/avs/avs.h +++ b/sound/soc/intel/avs/avs.h @@ -283,8 +283,8 @@ void avs_release_firmwares(struct avs_dev *adev); int avs_dsp_init_module(struct avs_dev *adev, u16 module_id, u8 ppl_instance_id, u8 core_id, u8 domain, void *param, u32 param_size, - u16 *instance_id); -void avs_dsp_delete_module(struct avs_dev *adev, u16 module_id, u16 instance_id, + u8 *instance_id); +void avs_dsp_delete_module(struct avs_dev *adev, u16 module_id, u8 instance_id, u8 ppl_instance_id, u8 core_id); int avs_dsp_create_pipeline(struct avs_dev *adev, u16 req_size, u8 priority, bool lp, u16 attributes, u8 *instance_id); diff --git a/sound/soc/intel/avs/dsp.c b/sound/soc/intel/avs/dsp.c index b881100d3e02..aa03af4473e9 100644 --- a/sound/soc/intel/avs/dsp.c +++ b/sound/soc/intel/avs/dsp.c @@ -225,7 +225,7 @@ static int avs_dsp_put_core(struct avs_dev *adev, u32 core_id) int avs_dsp_init_module(struct avs_dev *adev, u16 module_id, u8 ppl_instance_id, u8 core_id, u8 domain, void *param, u32 param_size, - u16 *instance_id) + u8 *instance_id) { struct avs_module_entry mentry; bool was_loaded = false; @@ -272,7 +272,7 @@ int avs_dsp_init_module(struct avs_dev *adev, u16 module_id, u8 ppl_instance_id, return ret; } -void avs_dsp_delete_module(struct avs_dev *adev, u16 module_id, u16 instance_id, +void avs_dsp_delete_module(struct avs_dev *adev, u16 module_id, u8 instance_id, u8 ppl_instance_id, u8 core_id) { struct avs_module_entry mentry; diff --git a/sound/soc/intel/avs/path.h b/sound/soc/intel/avs/path.h index 197222c5e008..657f7b093e80 100644 --- a/sound/soc/intel/avs/path.h +++ b/sound/soc/intel/avs/path.h @@ -37,7 +37,7 @@ struct avs_path_pipeline { struct avs_path_module { u16 module_id; - u16 instance_id; + u8 instance_id; union avs_gtw_attributes gtw_attrs; struct avs_tplg_module *template; diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c index 70a94201d6a5..275928281c6c 100644 --- a/sound/soc/intel/avs/probes.c +++ b/sound/soc/intel/avs/probes.c @@ -18,7 +18,7 @@ static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id { struct avs_probe_cfg cfg = {{0}}; struct avs_module_entry mentry; - u16 dummy; + u8 dummy; avs_get_module_entry(adev, &AVS_PROBE_MOD_UUID, &mentry); From patchwork Fri May 19 20:17:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13248277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18ED8C7EE23 for ; Fri, 19 May 2023 12:19:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 063633E7; Fri, 19 May 2023 14:18:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 063633E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684498766; bh=0mIwdJ2aflRied2pLi3obeU4WZxE26KjNZiOeSb7G4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IkaW9w+O6CPi8qrIh11THdiDJW0c62c3U6pJm2RNPrrIvMsDM5eJZhYXq/r+iOXDg VAbLcH5WEWGWFHMDIkmydzl+j2DwsFK0D/TpSoLqrSqgJOsLVt4kI8u0hgX+djai95 0lGaxSdsqJz+9iwKqOnTRCHAk9/tMbRTWsU3mCKI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 690CDF805C6; Fri, 19 May 2023 14:16:23 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8BF40F805CA; Fri, 19 May 2023 14:16:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9C5C7F8057C; Fri, 19 May 2023 14:16:11 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 04979F802E8 for ; Fri, 19 May 2023 14:16:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 04979F802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OxEOCbvN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684498567; x=1716034567; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0mIwdJ2aflRied2pLi3obeU4WZxE26KjNZiOeSb7G4g=; b=OxEOCbvNbaGkQvR3uX9tsnDyxNYrb3DxBTQKn194XvJ9V84cThTyIrow QeM3b+cVOPprL9GtVdyAZu7CmfiDo+yA06T4Ri3/zB1YzvbLElP72kvz3 EFUv95rAYIxKIGX8KYiHhOMuvCDAOy/NJCTJe3t7cIIbGq5APyrzvFXd/ UvW8erd6/DLFVHbDxyH3gG0r1pW5hwlL6VqGaKTwSksXY/A8GMDsqGxKq ehfOwnPTkAHSx86T7sRqCHR+HRf2KEaKZUonehkaVmsBqWJXo/D/vt1Pl 3fBGvcxaTr+KfJOapWZBT2dhE3urrSeqC66TBUvSOhfT8KT3Z0dTFPQrU g==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="355584468" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="355584468" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2023 05:16:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="733283712" X-IronPort-AV: E=Sophos;i="6.00,176,1681196400"; d="scan'208";a="733283712" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga008.jf.intel.com with ESMTP; 19 May 2023 05:16:03 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Cc: Cezary Rojewski , Takashi Iwai , Jaroslav Kysela , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= Subject: [PATCH 7/7] ASoC: Intel: avs: Add missing checks on FE startup Date: Fri, 19 May 2023 22:17:11 +0200 Message-Id: <20230519201711.4073845-8-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> References: <20230519201711.4073845-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: L23FY5NT5ZWNVJDMFSJCEBEAVSSU6OHX X-Message-ID-Hash: L23FY5NT5ZWNVJDMFSJCEBEAVSSU6OHX X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Constraint functions have return values, they should be checked for potential errors. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/pcm.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 31c032a0f7e4..1fbb2c2fadb5 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -468,21 +468,34 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so host_stream = snd_hdac_ext_stream_assign(bus, substream, HDAC_EXT_STREAM_TYPE_HOST); if (!host_stream) { - kfree(data); - return -EBUSY; + ret = -EBUSY; + goto err; } data->host_stream = host_stream; - snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); + ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) + goto err; + /* avoid wrap-around with wall-clock */ - snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 20, 178000000); - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_rates); + ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 20, 178000000); + if (ret < 0) + goto err; + + ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_rates); + if (ret < 0) + goto err; + snd_pcm_set_sync(substream); dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p", __func__, hdac_stream(host_stream)->stream_tag, substream); return 0; + +err: + kfree(data); + return ret; } static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)