public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-pcm: fix up bad merge
@ 2023-11-23  9:18 Johan Hovold
  2023-11-23 16:59 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2023-11-23  9:18 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
	Chancel Liu, linux-sound, linux-kernel, Johan Hovold

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 <johan+linaro@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: soc-pcm: fix up bad merge
  2023-11-23  9:18 [PATCH] ASoC: soc-pcm: fix up bad merge Johan Hovold
@ 2023-11-23 16:59 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-11-23 16:59 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
	Chancel Liu, linux-sound, linux-kernel

On Thu, 23 Nov 2023 10:18:15 +0100, Johan Hovold wrote:
> 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().
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: soc-pcm: fix up bad merge
      commit: 3841d8a563a7473ceb7415ecfe577e20b2a66d37

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-23 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23  9:18 [PATCH] ASoC: soc-pcm: fix up bad merge Johan Hovold
2023-11-23 16:59 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox