Patch "ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-soc-pcm-fix-hw-formats-cleared-by-soc_pcm_hw_in.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c8c5c262a74617eb3f422f5cf33436390d44da46
Author: Shengjiu Wang <shengjiu.wang@xxxxxxx>
Date:   Thu Mar 9 15:13:37 2023 +0800

    ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
    
    [ 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 <shengjiu.wang@xxxxxxx>
    Link: https://lore.kernel.org/r/1678346017-3660-1-git-send-email-shengjiu.wang@xxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux