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

Commit 1f166870 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: compress: dont aquire lock for draining states"

parents 0f6d8d26 0078bd74
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -297,6 +297,17 @@ static int soc_compr_trigger(struct snd_compr_stream *cstream, int cmd)
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	int ret = 0;

	/* for partial-drain/drain cmd, don't acquire lock while invoking DSP.
	 * These calls will be blocked till these operation can complete which
	 * will be a while. And during that time, app can invoke STOP, PAUSE etc
	 */
	if (cmd == SND_COMPR_TRIGGER_PARTIAL_DRAIN ||
				cmd == SND_COMPR_TRIGGER_DRAIN) {
		if (platform->driver->compr_ops &&
					platform->driver->compr_ops->trigger)
			return platform->driver->compr_ops->trigger(cstream, cmd);
	}

	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);

	if (platform->driver->compr_ops && platform->driver->compr_ops->trigger) {
@@ -325,6 +336,17 @@ static int soc_compr_trigger_fe(struct snd_compr_stream *cstream, int cmd)
	struct snd_soc_platform *platform = fe->platform;
	int ret = 0, stream;

	/* for partial-drain/drain cmd, don't acquire lock while invoking DSP.
	 * These calls will be blocked till these operation can complete which
	 * will be a while. And during that time, app can invoke STOP, PAUSE etc
	 */
	if (cmd == SND_COMPR_TRIGGER_PARTIAL_DRAIN ||
				cmd == SND_COMPR_TRIGGER_DRAIN) {
		if (platform->driver->compr_ops &&
					platform->driver->compr_ops->trigger)
			return platform->driver->compr_ops->trigger(cstream, cmd);
	}

	if (cstream->direction == SND_COMPRESS_PLAYBACK)
		stream = SNDRV_PCM_STREAM_PLAYBACK;
	else