Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a775613 authored by Meng Wang's avatar Meng Wang
Browse files

ALSA: pcm: add locks for accessing runtime resource



Add spin lock to resolve race conditions while
accessing substream runtime resource.

CRs-fixed: 2112713
Change-Id: I8db743303ceb50205d62adfc02caf6ecab635d47
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mengw@codeaurora.org>
parent 11b286fb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -475,6 +475,9 @@ struct snd_pcm_substream {
#endif /* CONFIG_SND_VERBOSE_PROCFS */
	/* misc flags */
	unsigned int hw_opened: 1;
#ifdef CONFIG_AUDIO_QGKI
	spinlock_t runtime_lock;
#endif
};

#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)