summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2017-01-24 11:44:00 +0000
committerMark Brown <broonie@kernel.org>2017-01-24 12:14:36 +0000
commite779974b86491cc938dfdcbfbf8fb363a40bc9ea (patch)
tree46a454fdf2ed84d8b3e30dc62a63561aee4dd37b /sound/soc
parentbb24ee411ae949eaffe24c6be2b3d87f271507b5 (diff)
downloadlinux-stable-e779974b86491cc938dfdcbfbf8fb363a40bc9ea.tar.gz
linux-stable-e779974b86491cc938dfdcbfbf8fb363a40bc9ea.tar.bz2
linux-stable-e779974b86491cc938dfdcbfbf8fb363a40bc9ea.zip
ASoC: wm_adsp: Set booted/running flags at the end of bring up
The booted and running flags should really only be set once all the steps at that power level have been complete. Currently operations can fail after the flags have been set, which would leave us in an inconsistent state where the flags are set but the things expected to reach that level have not happened. Whilst there isn't really any major impact from this it is best to clean it up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm_adsp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 09e50e5e7870..746a5e23cb8b 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2469,14 +2469,14 @@ static void wm_adsp2_boot_work(struct work_struct *work)
if (ret != 0)
goto err_ena;
- dsp->booted = true;
-
/* Turn DSP back off until we are ready to run */
ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL,
ADSP2_SYS_ENA, 0);
if (ret != 0)
goto err_ena;
+ dsp->booted = true;
+
mutex_unlock(&dsp->pwr_lock);
return;
@@ -2616,14 +2616,14 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
if (ret != 0)
goto err;
- dsp->running = true;
-
if (wm_adsp_fw[dsp->fw].num_caps != 0) {
ret = wm_adsp_buffer_init(dsp);
if (ret < 0)
goto err;
}
+ dsp->running = true;
+
mutex_unlock(&dsp->pwr_lock);
break;