From patchwork Thu Mar 7 14:01:46 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: 10842961 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 CF7181575 for ; Thu, 7 Mar 2019 14:02:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B88F72F0F7 for ; Thu, 7 Mar 2019 14:02:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B63882F0F0; Thu, 7 Mar 2019 14:02:57 +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 D70C42F0F0 for ; Thu, 7 Mar 2019 14:02:56 +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 05028853; Thu, 7 Mar 2019 15:02:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 05028853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1551967375; bh=thuk62Zj0S4bC606vW51xBG4RzYxPGChGYgi5mjdN9A=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=vhFCwOlvrUkBsfCo3ZLSOlZhSNF68CwtYJw60oACaNix+JuWDeg2WWDBdx53UPz7f NZJR1wxD9xny/5jIein1iC7LqFfNuD+2woUX5+bOV7pEfVAbLBkXMTPrxKz7IWHZ7x Rqk19cuHK3at1tCgmiOz/7TEVishQaNPw+wWK20g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 862ECF8065A; Thu, 7 Mar 2019 15:02:04 +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 6AFFFF896EC; Thu, 7 Mar 2019 15:02:02 +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 66243F896EC for ; Thu, 7 Mar 2019 15:01:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66243F896EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="jOg8xKcj" 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=Cy+80Mn1vCSGe8TSeEj6wGFFjh0OIarMTKk28su/bUE=; b=jOg8xKcjCxbfUEh16Kayjc7w9O kH3z1cpYvNfvv9l4KYV17bP5u9rILLN3ON+DouuwP1WrdypKWccJHz+dnYVSekiaGiZfQs56aGxVU NQf+305ChGt2N1Ra4xEC07m7jQpNkn+lQUfLVFPQCBJelHRmJ42umh8cSXrysReKjQ1oItw15B4tK 8xPqY3fBCq3Cm8OD+u/pirj7Oh+jzxjWbGSbtkYjzKxw2r3FtVRYhKXJKZrMLre6xDXu01EaQFBgw PVdb3n67sPBj8co8DCUcBtSwFLvdvFYuRhkpEdOzt2VKLUVV1a4JIQ/QLgxBkct07kckf5VsmIlFA 9EY5utag==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:56640 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 1h1tak-0006LA-TO; Thu, 07 Mar 2019 14:01:46 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1h1tak-0004bo-AV; Thu, 07 Mar 2019 14:01:46 +0000 From: Russell King To: Mark Brown MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 07 Mar 2019 14:01:46 +0000 Cc: jiada wang , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood Subject: [alsa-devel] [PATCH v2] 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. v2: also fixes the incorrect whitespace indentation copied from the original patch. 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..2a4246dbe55f 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;