From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6227DC7EE20 for ; Thu, 20 Apr 2023 11:05:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4C4A3EE9; Thu, 20 Apr 2023 13:04:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C4A3EE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681988731; bh=P1RJ20QJirQyRF3HhoWwKz3CHgv5xWwc6aSBD4SJCo4=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=K2EzPywz4h1LIqaOpib8jQ0fKV/6yl8eMWbhCcgbGQ+mdk2LGwZZwaU4jLN3aCzk0 264M0RkUMotOtKTzitkz3sHqU9CZlY7JoEveaGflGbjxYRJ6kk96/byMa8/cmIP2ec 2GLTS6sBrkf/4ZiJ1018nz4tee1arK7xdx5TrRkc= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DBC6BF8057B; Thu, 20 Apr 2023 13:02:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD3A3F80570; Thu, 20 Apr 2023 13:02:43 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F3172F80567 for ; Thu, 20 Apr 2023 13:02:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3172F80567 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=P5B0E5g8 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C291C647CA; Thu, 20 Apr 2023 11:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 437E3C433A0; Thu, 20 Apr 2023 11:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681988560; bh=P1RJ20QJirQyRF3HhoWwKz3CHgv5xWwc6aSBD4SJCo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5B0E5g8nYsnECEv4VvhTdTahIyRZmgcTPvrSDRacLogSKHCZgL4sanBqINZGywoH 7X5yuEk4HtUHxa3cwv23cu3UIuEOGzR9EVezpsRz0oy+BCKnKXOGsNjGBIbVeDwdXv EvahkTJ33UQ0AqDZSYIX+B7G1GqrSUPody429aGEKgL6Nzq+xJIRcy/U8miePxuiUt Dn2Au9+HhWI+A0krZRkCu6cuCrrBumbjpBAddccCYgtZJyXNv6PAqi5dFV06Q4vXOY BhBUxEIHEVMH60b9cXpaDuJb/HMOYLEcyk06w2BUasRZoGVLanmXvluLIDS34z7otk 3uQRkG6Ho+HVA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 03/15] ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm Date: Thu, 20 Apr 2023 07:02:17 -0400 Message-Id: <20230420110231.505992-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420110231.505992-1-sashal@kernel.org> References: <20230420110231.505992-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Message-ID-Hash: BE5GC5PISYWXVJK3AMSUDKVCXJGD7UG2 X-Message-ID-Hash: BE5GC5PISYWXVJK3AMSUDKVCXJGD7UG2 X-MailFrom: sashal@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Shengjiu Wang , Mark Brown , Sasha Levin , lgirdwood@gmail.com, tiwai@suse.com, alsa-devel@alsa-project.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Shengjiu Wang [ Upstream commit 083a25b18d6ad9f1f540e629909aa3eaaaf01823 ] The hw->formats may be set by snd_dmaengine_pcm_refine_runtime_hwparams() in component's startup()/open(), but soc_pcm_hw_init() will init hw->formats in dpcm_runtime_setup_fe() after component's startup()/open(), which causes the valuable hw->formats to be cleared. So need to store the hw->formats before initialization, then restore it after initialization. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1678346017-3660-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 35a16c3f9591b..7a486ca9633c1 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1649,10 +1649,14 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream) struct snd_pcm_hardware *hw = &runtime->hw; struct snd_soc_dai *dai; int stream = substream->stream; + u64 formats = hw->formats; int i; soc_pcm_hw_init(hw); + if (formats) + hw->formats &= formats; + for_each_rtd_cpu_dais(fe, i, dai) { struct snd_soc_pcm_stream *cpu_stream; -- 2.39.2