diff options
author | Keyon Jie <yang.jie@linux.intel.com> | 2021-01-05 17:56:40 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-01-12 16:40:23 +0000 |
commit | 8b66d7c58c11cf3b1a1cea738582367a96cdaaf8 (patch) | |
tree | ef54a1a2e99e731befc04d85889acc7377365a47 /sound/soc/sof/core.c | |
parent | f2973a1de9d9890b6ac712fb1825d3449ee9cc93 (diff) | |
download | linux-8b66d7c58c11cf3b1a1cea738582367a96cdaaf8.tar.gz |
ASoC: SOF: add mutex to protect the dsp_power_state access
There could be more than one thread read/write the dsp_power_state simultaneously (e.g. hda_dsp_d0i3_work and sof_ipc_tx_message), add a mutex power_state_access to make sure the access to it is mutually exclusive. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <bard.liao@intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210105155640.3725238-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/core.c')
-rw-r--r-- | sound/soc/sof/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index adc7c37145d6..2b85ef5d6092 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -316,6 +316,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) INIT_LIST_HEAD(&sdev->route_list); spin_lock_init(&sdev->ipc_lock); spin_lock_init(&sdev->hw_lock); + mutex_init(&sdev->power_state_access); if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) INIT_WORK(&sdev->probe_work, sof_probe_work); |