Commit e779974b authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bb24ee41
...@@ -2469,14 +2469,14 @@ static void wm_adsp2_boot_work(struct work_struct *work) ...@@ -2469,14 +2469,14 @@ static void wm_adsp2_boot_work(struct work_struct *work)
if (ret != 0) if (ret != 0)
goto err_ena; goto err_ena;
dsp->booted = true;
/* Turn DSP back off until we are ready to run */ /* Turn DSP back off until we are ready to run */
ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL,
ADSP2_SYS_ENA, 0); ADSP2_SYS_ENA, 0);
if (ret != 0) if (ret != 0)
goto err_ena; goto err_ena;
dsp->booted = true;
mutex_unlock(&dsp->pwr_lock); mutex_unlock(&dsp->pwr_lock);
return; return;
...@@ -2616,14 +2616,14 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, ...@@ -2616,14 +2616,14 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
if (ret != 0) if (ret != 0)
goto err; goto err;
dsp->running = true;
if (wm_adsp_fw[dsp->fw].num_caps != 0) { if (wm_adsp_fw[dsp->fw].num_caps != 0) {
ret = wm_adsp_buffer_init(dsp); ret = wm_adsp_buffer_init(dsp);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
dsp->running = true;
mutex_unlock(&dsp->pwr_lock); mutex_unlock(&dsp->pwr_lock);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment