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

Commit 4497205e authored by Bhalchandra Gajare's avatar Bhalchandra Gajare
Browse files

ASoC: msm-cpe-lsm: Improve handling of errors during buffering



The channel setup errors are not handled in some cases, add fix to
handle the errors gracefully for look ahead buffering.

CRs-fixed: 943741
Change-Id: Ifbaf8a05e0e1f4c7e099a1664e914d430345ee37
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent ac6766f8
Loading
Loading
Loading
Loading
+63 −66
Original line number Diff line number Diff line
@@ -547,8 +547,10 @@ static int msm_cpe_lab_thread(void *data)
	pr_debug("%s: Lab thread start\n", __func__);
	init_completion(&lab_d->comp);

	if (PCM_RUNTIME_CHECK(substream))
		return -EINVAL;
	if (PCM_RUNTIME_CHECK(substream)) {
		rc = -EINVAL;
		goto done;
	}

	if (!cpe || !cpe->core_handle) {
		pr_err("%s: Handle to %s is invalid\n",
@@ -571,7 +573,6 @@ static int msm_cpe_lab_thread(void *data)
	lsm_ops = &cpe->lsm_ops;
	afe_ops = &cpe->afe_ops;

	if (!kthread_should_stop()) {
	rc = lsm_ops->lab_ch_setup(cpe->core_handle,
				   session,
				   WCD_CPE_PRE_ENABLE);
@@ -637,13 +638,6 @@ static int msm_cpe_lab_thread(void *data)
		goto done;
	}

	} else {
		dev_dbg(rtd->dev,
			"%s: LAB stopped before starting read\n",
			 __func__);
		goto done;
	}

	while (!kthread_should_stop() &&
	       lab_d->thread_status != MSM_LSM_LAB_THREAD_ERROR) {

@@ -703,7 +697,10 @@ static int msm_cpe_lab_thread(void *data)
	}

done:
	pr_debug("%s: Exiting LAB thread\n", __func__);
	if (rc)
		lab_d->thread_status = MSM_LSM_LAB_THREAD_ERROR;
	pr_debug("%s: Exit lab_thread, exit_status=%d, thread_status=%d\n",
		 __func__, rc, lab_d->thread_status);
	complete(&lab_d->thread_complete);

	return 0;