From patchwork Thu Mar 7 13:59:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10842945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19CE01575 for ; Thu, 7 Mar 2019 14:00:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 034552E412 for ; Thu, 7 Mar 2019 14:00:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F261A2F09F; Thu, 7 Mar 2019 14:00:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0FED2E412 for ; Thu, 7 Mar 2019 14:00:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8D213853; Thu, 7 Mar 2019 14:59:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8D213853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1551967231; bh=vR3Tzx5dRZTWbu1QbXRQEdmoACa4CYfv53Gd+fLtJiE=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=OAVkM1k1WB+0adZuL45k5LrfWFCnZzNi49f5KZmcZnLSxPtuTgkjLS49nK8LYo/c7 qaQjI8DiFksez1jRnw4HWnJ7yFCfRHGt5jzleBAWQWlOA4KwevZKGCwepS3JrByumD Gc07YIAUztGlD5vc8uHHuY+SLStGcjlha2DMsjGg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0ADCAF806F7; Thu, 7 Mar 2019 14:59:41 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E97FEF896F0; Thu, 7 Mar 2019 14:59:39 +0100 (CET) Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1C810F8065A for ; Thu, 7 Mar 2019 14:59:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1C810F8065A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="y4/uR/0V" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oHLtXM6kiX8z0OOd1O0ZzXJcoumL8MN8j7T3dfM3M1c=; b=y4/uR/0VbO23/fzY2vcZbtFsSH D6UILE0PYmRc1krcwZDIDy+4uqunwaz+fnp9pL+gtj6p09HRayiq3OW+Kw4u2ALWn5o/TIIObEUj6 FO2A5hpj9ZQajAgVUfpxuP2GR428ca2whokvAbREQ+cuiZmvDNhr4vDNWy6E24D4h0UX6m+deYMSD JA6L0zPs1Ip3316fMlrbyNYswWDFVkypK8qd0WNWfn8+XAQRCCreg8lzxYL/fB3s7bXkxcwi2LdJt jXGcbrdWUQoawCUyx14WTDXoARueVpawJJkw2+vSZJKuJHYuTR+l0EzRNaA1iTIPri34Kt7XIhMW8 eWMQ3XYQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46680 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1h1tYN-0006JW-Pr; Thu, 07 Mar 2019 13:59:19 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1h1tYN-0004Z9-6M; Thu, 07 Mar 2019 13:59:19 +0000 From: Russell King To: Mark Brown MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 07 Mar 2019 13:59:19 +0000 Cc: jiada wang , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: soc-pcm: make symmetry work again X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit 957ce0c6b8a1 ("ASoC: soc-pcm: check symmetry after hw_params") moved the check for symmetry after we have set the cpu_dai's rate, channels and sample width to those in the params. The symmetry check verifies that the cpu dai's stored parameters are the same as those in the params. Since we have only just stored these parameters, this makes the symmetry checks always pass. Fix this by moving the symmetry check before we store the parameters, but after the parameters have been fixed up. Fixes: 957ce0c6b8a1 ("ASoC: soc-pcm: check symmetry after hw_params") Signed-off-by: Russell King --- Not tested: this is something I stumbled over while reading the code. sound/soc/soc-pcm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 08ee163504e8..dc3c3e31d2ef 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1010,15 +1010,16 @@ 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; + /* store the parameters for each DAIs */ cpu_dai->rate = params_rate(params); cpu_dai->channels = params_channels(params); cpu_dai->sample_bits = snd_pcm_format_physical_width(params_format(params)); - ret = soc_pcm_params_symmetry(substream, params); - if (ret) - goto component_err; out: mutex_unlock(&rtd->pcm_mutex); return ret;