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

Commit 7ec65dcd authored by Vicky Sehrawat's avatar Vicky Sehrawat
Browse files

ASoC: msm: qdsp6v2: Fix for deadlock issue



Locks in voice driver is acquired in a specific order
i.e common_lock first and then voice_data lock. However,
in voc_disable_cvp(), voice_data lock is acquired and
common_lock in voc_set_ext_ec_ref() which will lead to
a deadlock if called in different thread contexts.

CRs-fixed: 669106
Change-Id: I73fd9960198190f9b4a7f1eb2aa29bd46749d14b
Signed-off-by: default avatarVicky Sehrawat <vickys@codeaurora.org>
parent 70d51296
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4579,7 +4579,9 @@ static int voc_disable_cvp(uint32_t session_id)
		ret = voice_send_disable_vocproc_cmd(v);
		if (ret < 0) {
			pr_err("%s:  disable vocproc failed\n", __func__);
			goto fail;

			mutex_unlock(&v->lock);
			goto done;
		}

		voice_send_cvp_deregister_vol_cal_cmd(v);
@@ -4588,10 +4590,12 @@ static int voc_disable_cvp(uint32_t session_id)

		v->voc_state = VOC_CHANGE;
	}
	mutex_unlock(&v->lock);

	if (common.ec_ref_ext)
		voc_set_ext_ec_ref(AFE_PORT_INVALID, false);
fail:	mutex_unlock(&v->lock);

done:
	return ret;
}