diff options
author | Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> | 2020-03-25 22:12:31 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-26 19:31:14 +0100 |
commit | 9ef91cad92ba75d17d5a5203230746c9d9009705 (patch) | |
tree | dcdc47d02607485c9e6853928a2786f02555ecc1 /sound/soc/sof/topology.c | |
parent | ASoC: SOF: (cosmetic) use for_each_pcm_streams() in sof_dai_load() (diff) | |
download | linux-9ef91cad92ba75d17d5a5203230746c9d9009705.tar.xz linux-9ef91cad92ba75d17d5a5203230746c9d9009705.zip |
ASoC: SOF: fix uninitialised "work" with VirtIO
In the VirtIO case the sof_pcm_open() function isn't called on the
host during guest streaming, which then leaves "work" structures
uninitialised. However it is then used to handle position update
messages from the DSP. Move their initialisation to immediately after
allocation of the containing structure.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | sound/soc/sof/topology.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 54437caf9488..fe8ba3e05e08 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -9,6 +9,7 @@ // #include <linux/firmware.h> +#include <linux/workqueue.h> #include <sound/tlv.h> #include <sound/pcm_params.h> #include <uapi/sound/sof/tokens.h> @@ -2461,8 +2462,11 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, spcm->scomp = scomp; - for_each_pcm_streams(stream) + for_each_pcm_streams(stream) { spcm->stream[stream].comp_id = COMP_ID_UNASSIGNED; + INIT_WORK(&spcm->stream[stream].period_elapsed_work, + snd_sof_pcm_period_elapsed_work); + } spcm->pcm = *pcm; dev_dbg(scomp->dev, "tplg: load pcm %s\n", pcm->dai_name); |