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

Commit ce64394a authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm-cpe-lsm: Make sure LAB data channel is stopped



It is possible that the LAB thread would be in error state when
attempting to stop LAB. In such case, driver should still remove the
data channel for LAB to avoid data channel being left active. If this
is not done, it is possible that LAB setup for the next keyword may
fail. Fix this issue by making sure the LAB data channel is stopped even
if the thread status is in error state.

CRs-fixed: 790731
Change-Id: Ibccc10f79eb23e2249c32c7122f23dbed3657e20
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent 3f466670
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -271,7 +271,10 @@ static int msm_cpe_lsm_lab_stop(struct snd_pcm_substream *substream)
	session = lsm_d->lsm_session;
	lab_sess = &session->lab;

	if (lab_sess->thread_status == MSM_LSM_LAB_THREAD_RUNNING) {
	if (lab_sess->thread_status != MSM_LSM_LAB_THREAD_STOP) {

		if (lab_sess->thread_status ==
		    MSM_LSM_LAB_THREAD_RUNNING) {
			dev_dbg(rtd->dev, "%s: stopping lab thread\n",
				__func__);
			rc = kthread_stop(session->lsm_lab_thread);
@@ -284,9 +287,9 @@ static int msm_cpe_lsm_lab_stop(struct snd_pcm_substream *substream)
				dev_err(rtd->dev,
					"%s: Wait for lab thread timedout\n",
					__func__);
			lab_sess->thread_status = MSM_LSM_LAB_THREAD_ERROR;
				return -ETIMEDOUT;
			}
		}

		lab_sess->thread_status = MSM_LSM_LAB_THREAD_STOP;
		rc = lsm_ops->lsm_lab_stop(cpe->core_handle, session);