Commit cdaafbf2 authored by Takashi Iwai's avatar Takashi Iwai Committed by Treehugger Robot
Browse files

UPSTREAM: ASoC: soc-pcm: serialize BE triggers



[ Upstream commit b2ae8066 ]

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: default avatarTakashi Iwai <tiwai@suse.de>
[test, checkpatch fix and clarification of commit message by plbossart]
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211207173745.15850-5-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Fixes: aa9ff6a4 ("ASoC: soc-compress: Reposition and add pcm_mutex")
Signed-off-by: default avatarYixuan Jiang <yixuanjiang@google.com>
Cc: stable@vger.kernel.org # 5.15+

Bug: 287928097
Bug: 277241308
Link: https://lore.kernel.org/all/20230511120841.2096524-5-yixuanjiang@google.com


Change-Id: I8581d910436c9e8f93ee8ef2d0c19d3e2d23dc09
Signed-off-by: default avatarYixuan Jiang <yixuanjiang@google.com>
Signed-off-by: default avatarWill McVicker <willmcvicker@google.com>
parent a64a5028
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment