Merge "ASoC: compress: dont aquire lock for draining states"
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 3d9f043..3d8033b 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -301,6 +301,17 @@
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	int ret = 0;
 
+	/* for partial drain and 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) {
@@ -331,6 +342,17 @@
 	struct snd_soc_platform *platform = fe->platform;
 	int ret = 0, stream;
 
+	/* for partial drain and 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