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

Commit 3266dc57 authored by Narsinga Rao Chella's avatar Narsinga Rao Chella
Browse files

ASoC: msm: qdsp6v2: fix ADSP error handling for source tracking



As part of error code propagation from ADSP, the adm call back
function has been modified such that the member variable used
by the caller function to wake up the thread was updated with the
ADSP error code instead of a boolean value of 1. But the source
tracking function is not updated accordingly and the functionality
is broken. Fix the issue by making corresponding code changes for
source tracking.

CRs-fixed: 882572
Change-Id: Idaabd8364c53238463a5a34cfd1b38f0aa8ffbdc
Signed-off-by: default avatarNarsinga Rao Chella <nrchella@codeaurora.org>
parent 77813844
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -4102,7 +4102,7 @@ int adm_get_source_tracking(int port_id, int copp_idx,
				+ sizeof(struct adm_param_data_v5);
	admp.reserved = 0;

	atomic_set(&this_adm.copp.stat[p_idx][copp_idx], 0);
	atomic_set(&this_adm.copp.stat[p_idx][copp_idx], -1);

	ret = apr_send_pkt(this_adm.apr, (uint32_t *)&admp);
	if (ret < 0) {
@@ -4113,13 +4113,23 @@ int adm_get_source_tracking(int port_id, int copp_idx,
		goto done;
	}
	ret = wait_event_timeout(this_adm.copp.wait[p_idx][copp_idx],
			atomic_read(&this_adm.copp.stat[p_idx][copp_idx]),
			atomic_read(&this_adm.copp.stat[p_idx][copp_idx]) >= 0,
			msecs_to_jiffies(TIMEOUT_MS));
	if (!ret) {
		pr_err("%s - get params timed out\n", __func__);

		ret = -EINVAL;
		goto done;
	} else if (atomic_read(&this_adm.copp.stat
				[p_idx][copp_idx]) > 0) {
		pr_err("%s: DSP returned error[%s]\n",
			__func__, adsp_err_get_err_str(
			atomic_read(&this_adm.copp.stat
			[p_idx][copp_idx])));
		ret = adsp_err_get_lnx_err_code(
				atomic_read(&this_adm.copp.stat
					[p_idx][copp_idx]));
		goto done;
	}

	if (this_adm.sourceTrackingData.apr_cmd_status != 0) {