]> 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)
commit4280f81c5339f1dea7c21a865f1222fbf5d2eebd
treed92cb896969d3041cc02ac73a6287cbf86cd3498
parentdc62d188e0da6d6f243f5db4790c654e8d1b8640
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