]>
Commit | Line | Data |
---|---|---|
a65d4bac GKH |
1 | From foo@baz Sat Jul 28 10:25:26 CEST 2018 |
2 | From: Kai Chieh Chuang <kaichieh.chuang@mediatek.com> | |
3 | Date: Mon, 28 May 2018 10:18:18 +0800 | |
4 | Subject: ASoC: dpcm: fix BE dai not hw_free and shutdown | |
5 | ||
6 | From: Kai Chieh Chuang <kaichieh.chuang@mediatek.com> | |
7 | ||
8 | [ Upstream commit 9c0ac70ad24d76b873c1551e27790c7f6a815d5c ] | |
9 | ||
10 | In case, one BE is used by two FE1/FE2 | |
11 | FE1--->BE--> | |
12 | | | |
13 | FE2----] | |
14 | when FE1/FE2 call dpcm_be_dai_hw_free() together | |
15 | the BE users will be 2 (> 1), hence cannot be hw_free | |
16 | the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP | |
17 | ||
18 | later FE1/FE2 call dpcm_be_dai_shutdown(), | |
19 | will be skip due to wrong state. | |
20 | leaving the BE not being hw_free and shutdown. | |
21 | ||
22 | The BE dai will be hw_free later when calling | |
23 | dpcm_be_dai_shutdown() if still in invalid state. | |
24 | ||
25 | Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> | |
26 | Signed-off-by: Mark Brown <broonie@kernel.org> | |
27 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
28 | Signed-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); |