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 D6213C77B72 for ; Thu, 20 Apr 2023 11:03:50 +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 CB9F2EDB; Thu, 20 Apr 2023 13:02:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CB9F2EDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681988628; bh=0li5shSte6JliYNG2fbsa6AiMwV9Jr69Wb0Kk4pbDis=; 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=j7kWmRRz4mfxY7AyNAQo+Wgqw1h8SiqMl9BLRZLqUPiXYSIyEZOTGQZMTBDzGMo8B XwXhXtgcHkx33B0Zprx53jrEt8s4JT+QXOKzGtVvkvBOmK0njycqU1gCifcZEEUuz9 C3SYbmnB1irF1edali6j4cuVYtRsUPDEsR+yQ7Ak= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0ED29F80528; Thu, 20 Apr 2023 13:02:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E58FF8019B; Thu, 20 Apr 2023 13:02:04 +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 ED1DBF80155 for ; Thu, 20 Apr 2023 13:01:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ED1DBF80155 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=SWARJgkY 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 B36E6647C1; Thu, 20 Apr 2023 11:01:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 459ACC433A0; Thu, 20 Apr 2023 11:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681988518; bh=0li5shSte6JliYNG2fbsa6AiMwV9Jr69Wb0Kk4pbDis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWARJgkYykx3Aa2zyGZsAU6eWgWJsQ0Fy5BzfjXdjp/RozjBGKwdE2n4EfLbfhw4r BuDUSNn0JXXm9ktj98MJtlCqpHL4BWqFj/yV/HuY0LraW/borioTTv/8fAiKohJ8bz Bss4xHFS7YU55kCa1IGy+jn02OFgx6b7Yy9TJL0rFitBjvk4DMdXWxtULkTy9pY5qC +zVEBsTclq2qVGgVnZPp9aluJMklR99s5V/rrq2w/3mX67/nYi74ShDp4leQmEGW+C MwngaoYdMcxlFt+x6Zi9I8uC09DbpmycW7X3LCu3TGHbpGC4T78C4rjztOp+AkCsuE hJXtoQR3MZvyw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.2 03/17] ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm Date: Thu, 20 Apr 2023 07:01:32 -0400 Message-Id: <20230420110148.505779-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420110148.505779-1-sashal@kernel.org> References: <20230420110148.505779-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Message-ID-Hash: 3OSOF65PDEM4JCW3NANLCA6BRCVEUHOS X-Message-ID-Hash: 3OSOF65PDEM4JCW3NANLCA6BRCVEUHOS 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 579a44d81d9a3..d409b99af75b2 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