]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-pcm: serialize BE triggers
authorTakashi Iwai <tiwai@suse.de>
Tue, 7 Dec 2021 17:37:43 +0000 (11:37 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 14 Dec 2021 17:15:46 +0000 (17:15 +0000)
commit81dbc8d3e14999b21a6da23e41bcf55af0da0f73
treed92cb896969d3041cc02ac73a6287cbf86cd3498
parent2301d15481d4d8d5847232934137ecc7234d723c
ASoC: soc-pcm: serialize BE triggers

When more than one FE is connected to a BE, e.g. in a mixing use case,
the BE can be triggered multiple times when the FE are opened/started
concurrently. This race condition is problematic in the case of
SoundWire BE dailinks, and this is not desirable in a general
case.

This patch relies on the existing BE PCM lock, which takes atomicity into
account. The locking model assumes that all interactions start with
the FE, so that there is no deadlock between FE and BE locks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
[test, checkpatch fix and clarification of commit message by plbossart]
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211207173745.15850-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c