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

Commit c738eaea authored by Narender Ankam's avatar Narender Ankam Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: hdcp: synchronize HDCP1 qseecom commands



HDCP driver tries to send two different HDCP1
commands concurrently which leads to XPU violation.
Synchronize HDCP1 qseecom command transfer calls.

Change-Id: I829cc9aff6589c0b816337946e6044bc9d450cc3
Signed-off-by: default avatarNarender Ankam <nankam@codeaurora.org>
Signed-off-by: default avatarRamendra Kumar <ramendra@codeaurora.org>
parent fa73fb84
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -2396,13 +2396,19 @@ int hdcp1_set_keys(uint32_t *aksv_msb, uint32_t *aksv_lsb)
	if (aksv_msb == NULL || aksv_lsb == NULL)
		return -EINVAL;

	if (!hdcp1_supported || !hdcp1_handle)
		return -EINVAL;
	mutex_lock(&hdcp1_ta_cmd_lock);

	if (!hdcp1_supported || !hdcp1_handle) {
		rc = -EINVAL;
		goto end;
	}

	hdcp1_qsee_handle = hdcp1_handle->qsee_handle;

	if (!hdcp1_qsee_handle)
		return -EINVAL;
	if (!hdcp1_qsee_handle) {
		rc = -EINVAL;
		goto end;
	}

	/* set keys and request aksv */
	key_set_req = (struct hdcp1_key_set_req *)hdcp1_qsee_handle->sbuf;
@@ -2418,13 +2424,15 @@ int hdcp1_set_keys(uint32_t *aksv_msb, uint32_t *aksv_lsb)

	if (rc < 0) {
		pr_err("qseecom cmd failed err=%d\n", rc);
		return -ENOKEY;
		rc = -ENOKEY;
		goto end;
	}

	rc = key_set_rsp->ret;
	if (rc) {
		pr_err("set key cmd failed, rsp=%d\n", key_set_rsp->ret);
		return -ENOKEY;
		rc = -ENOKEY;
		goto end;
	}

	/* copy bytes into msb and lsb */
@@ -2437,7 +2445,9 @@ int hdcp1_set_keys(uint32_t *aksv_msb, uint32_t *aksv_lsb)
	*aksv_lsb |= key_set_rsp->ksv[6] << 8;
	*aksv_lsb |= key_set_rsp->ksv[7];

	return 0;
end:
	mutex_unlock(&hdcp1_ta_cmd_lock);
	return rc;
}

int hdcp1_validate_receiver_ids(struct hdcp_srm_device_id_t *device_ids,