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

Commit 6e04697f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cvp: Fix fence path concurrent issue"

parents 4db48be7 ef92fd1c
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -407,14 +407,6 @@ static int hfi_process_session_cvp_operation_config(u32 device_id,
	return 0;
}

static int hfi_process_session_cvp_dfs(u32 device_id,
	void *pkt,
	struct msm_cvp_cb_info *info)
{
	dprintk(CVP_ERR, "Deprecated DFS handling path\n");
		return -EINVAL;
}

static struct msm_cvp_inst *cvp_get_inst_from_id(struct msm_cvp_core *core,
	unsigned int session_id)
{
@@ -477,8 +469,7 @@ static int hfi_process_session_cvp_msg(u32 device_id,
	}

	if (inst->deprecate_bitmask) {
		if (pkt->packet_type == HFI_MSG_SESSION_CVP_DFS
			|| pkt->packet_type == HFI_MSG_SESSION_CVP_DME
		if (pkt->packet_type == HFI_MSG_SESSION_CVP_DME
			|| pkt->packet_type == HFI_MSG_SESSION_CVP_ICA
			|| pkt->packet_type == HFI_MSG_SESSION_CVP_FD) {
			u64 ktid;
@@ -619,26 +610,20 @@ static int _deprecated_hfi_msg_process(u32 device_id,
	struct msm_cvp_cb_info *info,
	struct msm_cvp_inst *inst)
{
	if (pkt->packet_type == HFI_MSG_SESSION_CVP_DFS)
		if (test_and_clear_bit(DFS_BIT_OFFSET,
				&inst->deprecate_bitmask))
			return hfi_process_session_cvp_dfs(
					device_id, (void *)pkt, info);

	if (pkt->packet_type == HFI_MSG_SESSION_CVP_DME)
		if (test_and_clear_bit(DME_BIT_OFFSET,
		if (test_bit(DME_BIT_OFFSET,
				&inst->deprecate_bitmask))
			return hfi_process_session_cvp_dme(
					device_id, (void *)pkt, info);

	if (pkt->packet_type == HFI_MSG_SESSION_CVP_ICA)
		if (test_and_clear_bit(ICA_BIT_OFFSET,
		if (test_bit(ICA_BIT_OFFSET,
				&inst->deprecate_bitmask))
			return hfi_process_session_cvp_ica(
				device_id, (void *)pkt, info);

	if (pkt->packet_type == HFI_MSG_SESSION_CVP_FD)
		if (test_and_clear_bit(FD_BIT_OFFSET,
		if (test_bit(FD_BIT_OFFSET,
				&inst->deprecate_bitmask))
			return hfi_process_session_cvp_fd(
				device_id, (void *)pkt, info);
+6 −0
Original line number Diff line number Diff line
@@ -1065,6 +1065,7 @@ static int msm_cvp_thread_fence_run(void *data)
			}
		}

		mutex_lock(&inst->fence_lock);
		rc = call_hfi_op(hdev, session_send,
				(void *)inst->session, in_pkt);
		if (rc) {
@@ -1085,6 +1086,7 @@ static int msm_cvp_thread_fence_run(void *data)
				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
		mutex_unlock(&inst->fence_lock);

		if (ica_enabled) {
			rc = synx_import(fence[2], fence[3], &synx_obj);
@@ -1164,6 +1166,7 @@ static int msm_cvp_thread_fence_run(void *data)
			}
		}

		mutex_lock(&inst->fence_lock);
		rc = call_hfi_op(hdev, session_send,
				(void *)inst->session, in_pkt);
		if (rc) {
@@ -1184,6 +1187,7 @@ static int msm_cvp_thread_fence_run(void *data)
				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
		mutex_unlock(&inst->fence_lock);

		rc = synx_import(fence[2], fence[3], &synx_obj);
		if (rc) {
@@ -1235,6 +1239,7 @@ static int msm_cvp_thread_fence_run(void *data)
			}
		}

		mutex_lock(&inst->fence_lock);
		rc = call_hfi_op(hdev, session_send,
				(void *)inst->session, in_pkt);
		if (rc) {
@@ -1255,6 +1260,7 @@ static int msm_cvp_thread_fence_run(void *data)
				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
		mutex_unlock(&inst->fence_lock);

		for (i = start_out; i <  start_out + out_fence_num; i++) {
			if (fence[(i<<1)]) {
+3 −0
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ void *msm_cvp_open(int core_id, int session_type)
	pr_info(CVP_DBG_TAG "Opening cvp instance: %pK\n", "info", inst);
	mutex_init(&inst->sync_lock);
	mutex_init(&inst->lock);
	mutex_init(&inst->fence_lock);
	spin_lock_init(&inst->event_handler.lock);

	INIT_MSM_CVP_LIST(&inst->persistbufs);
@@ -345,6 +346,7 @@ void *msm_cvp_open(int core_id, int session_type)
	mutex_unlock(&core->lock);
	mutex_destroy(&inst->sync_lock);
	mutex_destroy(&inst->lock);
	mutex_destroy(&inst->fence_lock);

	DEINIT_MSM_CVP_LIST(&inst->persistbufs);
	DEINIT_MSM_CVP_LIST(&inst->cvpcpubufs);
@@ -393,6 +395,7 @@ int msm_cvp_destroy(struct msm_cvp_inst *inst)

	mutex_destroy(&inst->sync_lock);
	mutex_destroy(&inst->lock);
	mutex_destroy(&inst->fence_lock);

	msm_cvp_debugfs_deinit_inst(inst);
	_deinit_session_queue(inst);
+1 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ struct msm_cvp_inst {
	struct cvp_kmd_request_power power;
	struct cvp_session_prop prop;
	u32 cur_cmd_type;
	struct mutex fence_lock;
};

struct msm_cvp_fence_thread_data {