From patchwork Thu Mar 1 19:42:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 130406 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp450920lja; Thu, 1 Mar 2018 11:42:50 -0800 (PST) X-Google-Smtp-Source: AG47ELtsO+WrydaUDwORwl29M6eqjzTUq9Vm4E0l+rSpH/R7dfiA7ZcD44ibcyKv+KVYqC/G6PBY X-Received: by 10.223.138.203 with SMTP id z11mr2698647wrz.199.1519933370308; Thu, 01 Mar 2018 11:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519933370; cv=none; d=google.com; s=arc-20160816; b=Vk18ASFrDba0iQRBvmW+i1ga6JXJYrA9qK2fcxKrR/H2E/GS8mxYROQ4J0CmBWl5mz 9x4tQgvK92P4m5FvegQarH3gCj2keXQbi8F2TyR4cWyhzXhCei/iJU3kQFHNVxl31yZd AXr0wR0Z1BnNZTl9nGjQZU/AmLBdP8HpqJoLdA7yTijUKhXMVH49g0ArpXVJuHn9nRmH vNKGWUJ2739oIhCaVAAd4CJ9qB0yj4yJSzVUCJEbj3cnuVlymBAfGnH9vTTG7bOOJkAa xFri/3QHl0fi2M8v0Mzq964aUp7pN+bKQIyyli4XA3AA1hykWXNd+LaCnkW+WtVg+y7u YxOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=dZQgyiLfqKTR8Yq8lUeloQRkauhSKxF64iXT9NNFc+0=; b=dfm2wmVV8UIFeNal9LTqktb0JANS/2YFdUI1s4j94bMCvnPpCBfnWerF/kR1nirtWN tjJGMJpHmUhjg4pcPMjJJ+0ObJsb/T7nm82uEwguv1bWuEx06XiB25M0q6i9ATjMBoM4 kA8bp+KmLMD0/hJapf9sth2G5xs3Nv+1Xc531xF0gwG/QO0JxxFD+H6CFgLyvfHxfibj 657YfwCZ09FIeROeLfF3VSObvDVrWEG5YiwmL43pNLWhZw0x3cBiYpe9PuMhIhy2GiKw jpukQcbfV5QKk5XqhhzTY0NI5VL9+GHyAjJ8VDN16cimDYasxbzaCsgzsLWALOd8f0Ox F63A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=maj6OaWf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id l7si3623937wrb.54.2018.03.01.11.42.50; Thu, 01 Mar 2018 11:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=maj6OaWf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C8DEC267BDE; Thu, 1 Mar 2018 20:42:32 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3746C267BDB; Thu, 1 Mar 2018 20:42:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id A6E03267BD0 for ; Thu, 1 Mar 2018 20:42:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=dpjI2SsjM15oh5kL9NByUk+f6cHJUCqI7Dbtd4/UleA=; b=maj6OaWftERH Zste3FRpnp47/rKmsJxCjkc/UrqVSy2jh0WJOQjZVOB5UDkj3bcG/dYEdPG2sbBGPCyxzVXSZHPNC AaDObK1KnrXV7KmMB8twid7L5Kcc6GWOWGoaHVi5jqonWzoCl0R7coUv8GXfobtFMZnPp1yqgkdYq PcQsM=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1erU5s-0005nI-7L; Thu, 01 Mar 2018 19:42:20 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1erU5r-0003Rf-P9; Thu, 01 Mar 2018 19:42:19 +0000 From: Mark Brown To: Guneshwor Singh In-Reply-To: <20180127042025.22042-2-guneshwor.o.singh@intel.com> Message-Id: Date: Thu, 01 Mar 2018 19:42:19 +0000 Cc: alsa-devel@alsa-project.org, Takashi Iwai , Patches Audio , Liam Girdwood , Vinod Koul , Mark Brown Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Refine skl widget type check" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: Skylake: Refine skl widget type check has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From cb1f904d91c52bc4e03e11eb161288c40c655095 Mon Sep 17 00:00:00 2001 From: Guneshwor Singh Date: Sat, 27 Jan 2018 09:50:21 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Refine skl widget type check The current check is not effective when all the widgets of a card are involved since other widgets also can be of same type. So, make widget type check more stringent by checking dev pointer additionally. Signed-off-by: Guneshwor Singh Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-topology.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 73af6e19ebbd..dbe6a19b84f5 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -94,8 +94,12 @@ void skl_tplg_d0i3_put(struct skl *skl, enum d0i3_capability caps) * SKL DSP driver modelling uses only few DAPM widgets so for rest we will * ignore. This helpers checks if the SKL driver handles this widget type */ -static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w) +static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w, + struct device *dev) { + if (w->dapm->dev != dev) + return false; + switch (w->id) { case snd_soc_dapm_dai_link: case snd_soc_dapm_dai_in: @@ -969,7 +973,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, next_sink = p->sink; - if (!is_skl_dsp_widget_type(p->sink)) + if (!is_skl_dsp_widget_type(p->sink, ctx->dev)) return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig); /* @@ -978,7 +982,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, * they are ones used for SKL so check that first */ if ((p->sink->priv != NULL) && - is_skl_dsp_widget_type(p->sink)) { + is_skl_dsp_widget_type(p->sink, ctx->dev)) { sink = p->sink; sink_mconfig = sink->priv; @@ -1092,7 +1096,7 @@ static struct snd_soc_dapm_widget *skl_get_src_dsp_widget( * ones used for SKL so check that first */ if ((p->source->priv != NULL) && - is_skl_dsp_widget_type(p->source)) { + is_skl_dsp_widget_type(p->source, ctx->dev)) { return p->source; } } @@ -1654,7 +1658,7 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) w = dai->playback_widget; snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && p->sink->power && - !is_skl_dsp_widget_type(p->sink)) + !is_skl_dsp_widget_type(p->sink, dai->dev)) continue; if (p->sink->priv) { @@ -1667,7 +1671,7 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) w = dai->capture_widget; snd_soc_dapm_widget_for_each_source_path(w, p) { if (p->connect && p->source->power && - !is_skl_dsp_widget_type(p->source)) + !is_skl_dsp_widget_type(p->source, dai->dev)) continue; if (p->source->priv) { @@ -1819,7 +1823,7 @@ static int skl_tplg_be_set_src_pipe_params(struct snd_soc_dai *dai, int ret = -EIO; snd_soc_dapm_widget_for_each_source_path(w, p) { - if (p->connect && is_skl_dsp_widget_type(p->source) && + if (p->connect && is_skl_dsp_widget_type(p->source, dai->dev) && p->source->priv) { ret = skl_tplg_be_fill_pipe_params(dai, @@ -1844,7 +1848,7 @@ static int skl_tplg_be_set_sink_pipe_params(struct snd_soc_dai *dai, int ret = -EIO; snd_soc_dapm_widget_for_each_sink_path(w, p) { - if (p->connect && is_skl_dsp_widget_type(p->sink) && + if (p->connect && is_skl_dsp_widget_type(p->sink, dai->dev) && p->sink->priv) { ret = skl_tplg_be_fill_pipe_params(dai, @@ -2752,7 +2756,7 @@ void skl_cleanup_resources(struct skl *skl) skl->resource.mcps = 0; list_for_each_entry(w, &card->widgets, list) { - if (is_skl_dsp_widget_type(w) && (w->priv != NULL)) + if (is_skl_dsp_widget_type(w, ctx->dev) && w->priv != NULL) skl_clear_pin_config(soc_platform, w); } @@ -3408,7 +3412,7 @@ static int skl_tplg_create_pipe_widget_list(struct snd_soc_platform *platform) struct skl_pipe *pipe; list_for_each_entry(w, &platform->component.card->widgets, list) { - if (is_skl_dsp_widget_type(w) && w->priv != NULL) { + if (is_skl_dsp_widget_type(w, platform->dev) && w->priv) { mcfg = w->priv; pipe = mcfg->pipe;