From patchwork Sun Dec 29 17:26:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182567 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5466309ild; Sun, 29 Dec 2019 09:54:56 -0800 (PST) X-Google-Smtp-Source: APXvYqw/4mx0YHi6qyt/29FYs6zpoCCh4W0DBZBYPh4wZULY/QkeFEfs5ZpH/VTh4eiyePhbfbTS X-Received: by 2002:a9d:65cb:: with SMTP id z11mr49122975oth.348.1577642096587; Sun, 29 Dec 2019 09:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577642096; cv=none; d=google.com; s=arc-20160816; b=KLwx1/dWeujThU57bsWpA2LTmYnvVidpSycfWfPl32TNe5+BHUH/wjHTHn3wX7EXkm Flb7yU82lTr7ZXaZ5V8zFSfX59Y8dkZ63LsbVWFFr8iFx3dkG6FKBSUZXJt+ETxqYBDN AAW5u3R1jOt2vitd4bNORsdOsrUy3jMAJAHxxhZYE2zvrbxhePpuvvkHuDQ9NgNcSrsY 701MEu9TuFjdYmKB3u/EuHnF+zFUoohGufVHeb1xRQ3izybUgyh7OIwABCTF74obUI9y 09JJDl7ymDIc2ri7graRXAWBoU27Ikt+i8wTcgieCsnxkPcRtK4Dk29J6eYa80Znw5xC 9EJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pcJvC9AWZgdZW3rU2X4YFU2TtjuQ0Tm9hVCPBuCHyuQ=; b=S2aZdDdXwR7mfukjUSbSL36DsSmDhsMsbTeVhGPVUye3LmKtq4ZesrEtsmgwlbzlgf 5SY4aeK7m8ef7upBP5GHGX6mVzK+fM2yi0vnPjtEInOwquWBVIXiJ4v0peXuCypLdFUO 3oXQT25Cfkqx7rMKT37SFKrMPxxwo/5qYc7wkwDLotFNe2QZiQJjZd85uMFwNobWW2Gf g3pBrfrX2DRwmYCEoLjHcM4CXLsyYPM43Qm88IpX4QVi7CUG0HdGoMAyNYTlC2fBop7t 21ueTmdOg0hUXX/kcHJNov6xapYMOtAkkIHupllXa4Y56DdjtNIYEhbp2MAy9ZBp6vCa 1AOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D+9YLcbi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si17310833oiy.9.2019.12.29.09.54.56; Sun, 29 Dec 2019 09:54:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=D+9YLcbi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732823AbfL2Ryz (ORCPT + 27 others); Sun, 29 Dec 2019 12:54:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:43076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732283AbfL2Ryw (ORCPT ); Sun, 29 Dec 2019 12:54:52 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0686720718; Sun, 29 Dec 2019 17:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642091; bh=r4drbKus9o7E4e65lWGg21h6B6VQGYU7jpaonTNlv+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+9YLcbi30Sjzwmxn1NJqSlI0u3/MuycboTUNm9pU9eTBSWrW8vhjm7TXp6rFyHLt jQ3seTGmN7cDmAMT4WoIXs0m8tc9Hg4YI/KK/tY/T0FqjBL/PpTBMa8fy4k1hfMCT6 Yd5diClLELPrvNPPEwCbgdVbEgLbVsbTCndDv8uE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.4 339/434] ASoC: soc-pcm: check symmetry before hw_params Date: Sun, 29 Dec 2019 18:26:32 +0100 Message-Id: <20191229172724.486261658@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang [ Upstream commit 5cca59516de5df9de6bdecb328dd55fb5bcccb41 ] This reverts commit 957ce0c6b8a1f (ASoC: soc-pcm: check symmetry after hw_params). 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 Link: https://lore.kernel.org/r/1573555602-5403-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index cdce96a3051b..a6e96cf1d8ff 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -877,6 +877,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) { @@ -958,9 +963,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;