]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/asoc-dpcm-fix-be-dai-not-hw_free-and-shutdown.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / asoc-dpcm-fix-be-dai-not-hw_free-and-shutdown.patch
CommitLineData
a65d4bac
GKH
1From foo@baz Sat Jul 28 10:25:26 CEST 2018
2From: Kai Chieh Chuang <kaichieh.chuang@mediatek.com>
3Date: Mon, 28 May 2018 10:18:18 +0800
4Subject: ASoC: dpcm: fix BE dai not hw_free and shutdown
5
6From: Kai Chieh Chuang <kaichieh.chuang@mediatek.com>
7
8[ Upstream commit 9c0ac70ad24d76b873c1551e27790c7f6a815d5c ]
9
10In case, one BE is used by two FE1/FE2
11FE1--->BE-->
12 |
13FE2----]
14when FE1/FE2 call dpcm_be_dai_hw_free() together
15the BE users will be 2 (> 1), hence cannot be hw_free
16the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP
17
18later FE1/FE2 call dpcm_be_dai_shutdown(),
19will be skip due to wrong state.
20leaving the BE not being hw_free and shutdown.
21
22The BE dai will be hw_free later when calling
23dpcm_be_dai_shutdown() if still in invalid state.
24
25Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
26Signed-off-by: Mark Brown <broonie@kernel.org>
27Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 sound/soc/soc-pcm.c | 6 ++++--
31 1 file changed, 4 insertions(+), 2 deletions(-)
32
33--- a/sound/soc/soc-pcm.c
34+++ b/sound/soc/soc-pcm.c
35@@ -1779,8 +1779,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_
36 continue;
37
38 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
39- (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN))
40- continue;
41+ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) {
42+ soc_pcm_hw_free(be_substream);
43+ be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE;
44+ }
45
46 dev_dbg(be->dev, "ASoC: close BE %s\n",
47 be->dai_link->name);