Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp371682ybc; Tue, 12 Nov 2019 02:50:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyDKeerbhNfti+aoOkAJyK2xZIlpTsorzRx1oALRkze2sCV5/ax1OeRl7aSRLzPiI0bXEBg X-Received: by 2002:aa7:d7d7:: with SMTP id e23mr30746517eds.236.1573555815889; Tue, 12 Nov 2019 02:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573555815; cv=none; d=google.com; s=arc-20160816; b=NifwqJ4g+VIvwxLTttv8gYzPes5qXd9f04iwMzIdpJc228tP8xDW90BWe6+XgdX+8s 6MhEZXyKrSjPxdoIp7IDZ7vceI2YJzw4n0omB2BgI5GKDwMek+Wl1BVVEmpHZ3eL1cWW l05z6hs8GMZOam/PWCnxWvcvgpllhbarWObmcoltgB9zXcuyXHFbrcAPKZopKEckbIbn nni2VtF9O6/4e6oaPuHS13fA4LFZxYaEmwaL89H8uByXAJ31IsSSx2PA0NuYGfnwSbsJ m3AQzPgSEEd59FKnPi1nJK0S0IVRDILVhDefbJNyXxsAku5LT8sOWz9MaWC8XUmuqrog vaYw== 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 j5si13405102edc.195.2019.11.12.02.49.51; Tue, 12 Nov 2019 02:50:15 -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 S1726957AbfKLKsb (ORCPT + 99 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(-) 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; -- 2.21.0