Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp205271rdh; Thu, 23 Nov 2023 01:19:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEs7n2OkJaJ4754iqAZnY6+D869SclKybhqk4LyS9WagarQqTrtMFYasWdUXRZAy8VfVnf X-Received: by 2002:a17:90b:1b46:b0:280:6e68:a5a8 with SMTP id nv6-20020a17090b1b4600b002806e68a5a8mr5129795pjb.22.1700731175423; Thu, 23 Nov 2023 01:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700731175; cv=none; d=google.com; s=arc-20160816; b=oh2VE2VESnwylyYhht8QzOyQMFsEkPdTKXi+y19Y+8K9hGksMmgKIKmwYzTzgC80gC YGxkxA/mV3ShcfRe/gjCfZ0tQ97IyDHLGPcDlMlX4HIaoJb+k+n5KOQYk+rMJN74Utjp XZKWBLY68kJGL+6aHnLHlokozvLQD/XSXCmtM/vxokw3Bqmjn6js2p2i488pz5OPgj/u RnqY3Tla1OAWAHxYhSZTsogpv9viIBEVsgsF2JBHRuiYnCLJxi0rC3y9VRl8TOdDnHGZ KDuBnOWIozPImOnCAlpvxTuinnPXomKx27T9Rq+xeWIzHE3MVfx6K08MlSM0kbtqUsEG Vkog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4DpHUYw/NdupB/WTFuIGvdQaKlDONkFhnrpuUKYx7CE=; fh=K7t4jjC2GfEnPFsiRmP4Iq/LwAdI78W3Cvc+nfk58lI=; b=dzjgjha6f+wXlQUKhhpJYuCKXXI7hHMqfdRN5JeqUFY+LqOCtN2ZBZaqJHvLYovLqD EoYajohbEeOCsgdLqBb6SiajkM6RCiLCVZhS65KcdTY+ameJUpFbEteUZmgTATj1ACFg 30oiFqshJS1x+rjZVB7fTBybUu1/7jCWv/0VcoK38rlHKjIrl1CaVmLDxj8+B7CNu9vo aRGfVnWjXcNa5hO1GFAm5e17m2QLBdNjO5ZaIJImIX7G7hZHS6cuo4KJH8EPUGHoQCB1 ls0ELePjO4QqS3sotnk5UGXUcsiliqGNyk3pBnRa/GzM9vqNpIt6Py0SVp/o9UpWGpLr iFmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F0JhFyVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l4-20020a17090ac58400b0027d30e575ccsi959749pjt.115.2023.11.23.01.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 01:19:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F0JhFyVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2CE498079AF4; Thu, 23 Nov 2023 01:19:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbjKWJTQ (ORCPT + 99 others); Thu, 23 Nov 2023 04:19:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWJTO (ORCPT ); Thu, 23 Nov 2023 04:19:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365FE19E for ; Thu, 23 Nov 2023 01:19:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1886C433C8; Thu, 23 Nov 2023 09:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700731160; bh=INV4VXsAI81QuQ1I3t6WPmgl0c6clKa/3BaJIVhZGXA=; h=From:To:Cc:Subject:Date:From; b=F0JhFyVM2+BsueqEwbUbsiJI7zpElGUGGbhwNiyktyYVGV3GyH4f3LCTjpN9Z29Tp uhH2WNC4c3OvQZpqAP7ZVDom4noucMZ5mvFtIcAx8UTzmIXxpVL8biqaNdVnls0A2P k2xw4kRTC/IpYpr9GoR5INBe6vd4olAvAbcdruzuGsEbhe+h+3qcWyWoDmYuMJi/OT awBD8DtkO9GNwA31w8icWPi7tjr8SpwBcQRiDYPkaPq+4rlAW87ezMBB/UAHxe7p45 jSueeQ8vMDLXarBKHQuVp/Oqj96sRrYmjrQNQPxffAxXtvOtFrdx2wwLuPG9Y8Zb/G Kq+ge42mcL6Zg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1r65s1-0005iG-32; Thu, 23 Nov 2023 10:19:37 +0100 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , Chancel Liu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] ASoC: soc-pcm: fix up bad merge Date: Thu, 23 Nov 2023 10:18:15 +0100 Message-ID: <20231123091815.21933-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 01:19:33 -0800 (PST) A recent change to address pops and clicks with codecs like WSA883X touched the same code paths as a fix for clearing DAI parameters and resulted in a bad merge. Specifically, commit f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") made mute at stream close conditional, while commit 3efcb471f871 ("ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive") moved that same mute call back to soc_pcm_hw_clean(). Fix up the bad merge by dropping the second mute call from soc_pcm_clean() and making sure that the call in soc_pcm_hw_clean() is conditional as intended. Fixes: bdb7e1922052 ("ASoC: Merge up workaround for CODECs that play noise on stopped stream") Signed-off-by: Johan Hovold --- sound/soc/soc-pcm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 323e4d7b6adf..f6d1b2e11795 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -704,11 +704,6 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *rtd, if (snd_soc_dai_active(dai) == 0 && (dai->rate || dai->channels || dai->sample_bits)) soc_pcm_set_dai_params(dai, NULL); - - if (snd_soc_dai_stream_active(dai, substream->stream) == 0) { - if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) - snd_soc_dai_digital_mute(dai, 1, substream->stream); - } } } @@ -947,8 +942,10 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd, if (snd_soc_dai_active(dai) == 1) soc_pcm_set_dai_params(dai, NULL); - if (snd_soc_dai_stream_active(dai, substream->stream) == 1) - snd_soc_dai_digital_mute(dai, 1, substream->stream); + if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 1, substream->stream); + } } /* run the stream event */ -- 2.41.0