From patchwork Tue Nov 12 10:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 179179 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7931484ilf; Tue, 12 Nov 2019 02:48:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyotAp1w6S9iWGXz3peqHbLgacWZpQ2PnGxJFLcoVFhz7ar2MAbZAOazJ7bNxRwyeGMVXrn X-Received: by 2002:a17:906:c797:: with SMTP id cw23mr27458532ejb.19.1573555715883; Tue, 12 Nov 2019 02:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573555715; cv=none; d=google.com; s=arc-20160816; b=bXKTyGiMemE7IpGJwIf4ntVO9msxAi7bZyz13/WrrLo5TgPkYd/Hn+vqjzx+3IoIPW ZQfGjhRilyBms6R9GLIXuFrPKiUhF/FTx5NPj8HlK7DYfRFNEeEVm9Q3X/DOxwdM96o1 GYN8g/YbVTOBNkMwkAYFRHkbpXGmErfnIIbM4+QKz5O3tX44aErJocaVIj0j7H+jJ6tq 2TMaIlb5yUui8f4/77mjsUKQKnpvDKrLNOVDNY4JQ0k3rIyCBxjsFob+59z2cjSyRYiu qG7b7oTFitsaTh3RifXSRy65O7YhOfXUGY5zoID22Ab40hpOtBMb4yFB7vlRp1LRlk9X u6aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=+fcHX0Tef6oo4/5Ame2WZyfPvvl+rtiK0TVVuxFzsbs=; b=lei33Ip2hI11k5XB1lupJHY+Uo+gcablrNrl0Dc+gmzwQ33hcQY/x6U5peNpP+Ah+W y3ugI+pUE8E8D67Hx602nJ+SFsN+D/FHMExCa0rFo3pqGmUOMZpuzJ+hIl7MCMcrFucG uE49A+7koP4spxnat94b2IdC/8VZJol3ho+VTS6J+Aa6bKb4TiKXqcwjQ6NLkZyz39Tz E4MyOmumQDx3dkXMYVeVBTrxTHwqy899A2VW6FaDS+g3Tk9CkFzyfDKSKs0IXv9d5DhL FDgaCKr9JASxdCLfNE5vH6hbbNhWOTjm/I7/Fm201o5ZhjN6hVwVM09a91GhzCv/egqz dF5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si11872876edm.17.2019.11.12.02.48.35; Tue, 12 Nov 2019 02:48:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfKLKsb (ORCPT + 26 others); Tue, 12 Nov 2019 05:48:31 -0500 Received: from inva020.nxp.com ([92.121.34.13]:33644 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfKLKsa (ORCPT ); Tue, 12 Nov 2019 05:48:30 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 078211A06E6; Tue, 12 Nov 2019 11:48:29 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 124321A0324; Tue, 12 Nov 2019 11:48:26 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6DF254024E; Tue, 12 Nov 2019 18:48:22 +0800 (SGT) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] Revert "ASoC: soc-pcm: check symmetry after hw_params" Date: Tue, 12 Nov 2019 18:46:42 +0800 Message-Id: <1573555602-5403-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 957ce0c6b8a1f26559864507ae0bfcba29d924ad. That commit cause soc_pcm_params_symmetry can't take effect. cpu_dai->rate, cpu_dai->channels and cpu_dai->sample_bits are updated in the middle of soc_pcm_hw_params, so move soc_pcm_params_symmetry to the end of soc_pcm_hw_params is not a good solution, for judgement of symmetry in the function is always true. FIXME: According to the comments of that commit, I think the case described in the commit should disable symmetric_rates in Back-End, rather than changing the position of soc_pcm_params_symmetry. Signed-off-by: Shengjiu Wang --- sound/soc/soc-pcm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.21.0 diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 8655df6a6089..b7800c95327a 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -861,6 +861,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, int i, ret = 0; mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); + + ret = soc_pcm_params_symmetry(substream, params); + if (ret) + goto out; + if (rtd->dai_link->ops->hw_params) { ret = rtd->dai_link->ops->hw_params(substream, params); if (ret < 0) { @@ -940,9 +945,6 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, } component = NULL; - ret = soc_pcm_params_symmetry(substream, params); - if (ret) - goto component_err; out: mutex_unlock(&rtd->card->pcm_mutex); return ret;