mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
msm: cvp: Relocate Synx init/uninit calls
Move synx init/uninit calls to session creation and deletion functions to avoid racing between synx release and uninit. Change-Id: I57d0a3e621f1fe7bacd811c03f89d754b4255b8e Signed-off-by: George Shen <sqiao@codeaurora.org>
This commit is contained in:
parent
cc72a30d25
commit
f24033302b
2 changed files with 8 additions and 9 deletions
|
|
@ -1806,6 +1806,7 @@ static int msm_cvp_unregister_buffer(struct msm_cvp_inst *inst,
|
|||
static int msm_cvp_session_create(struct msm_cvp_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct synx_initialization_params params;
|
||||
|
||||
if (!inst || !inst->core)
|
||||
return -EINVAL;
|
||||
|
|
@ -1835,6 +1836,12 @@ static int msm_cvp_session_create(struct msm_cvp_inst *inst)
|
|||
goto fail_init;
|
||||
}
|
||||
|
||||
params.name = "cvp-kernel-client";
|
||||
if (synx_initialize(&inst->synx_session_id, ¶ms)) {
|
||||
dprintk(CVP_ERR, "%s synx_initialize failed\n", __func__);
|
||||
rc = -EFAULT;
|
||||
}
|
||||
|
||||
fail_init:
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1860,17 +1867,10 @@ static int cvp_fence_thread_start(struct msm_cvp_inst *inst)
|
|||
struct task_struct *thread;
|
||||
struct cvp_fence_queue *q;
|
||||
struct cvp_session_queue *sq;
|
||||
struct synx_initialization_params params;
|
||||
|
||||
if (!inst->prop.fthread_nr)
|
||||
return 0;
|
||||
|
||||
params.name = "cvp-kernel-client";
|
||||
if (synx_initialize(&inst->synx_session_id, ¶ms)) {
|
||||
dprintk(CVP_ERR, "%s synx_initialize failed\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
q = &inst->fence_cmd_queue;
|
||||
spin_lock(&q->lock);
|
||||
q->state = QUEUE_ACTIVE;
|
||||
|
|
@ -1928,8 +1928,6 @@ static int cvp_fence_thread_stop(struct msm_cvp_inst *inst)
|
|||
wake_up_all(&q->wq);
|
||||
wake_up_all(&sq->wq);
|
||||
|
||||
synx_uninitialize(inst->synx_session_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ int msm_cvp_destroy(struct msm_cvp_inst *inst)
|
|||
|
||||
msm_cvp_debugfs_deinit_inst(inst);
|
||||
_deinit_session_queue(inst);
|
||||
synx_uninitialize(inst->synx_session_id);
|
||||
|
||||
pr_info(CVP_DBG_TAG "Closed cvp instance: %pK session_id = %d\n",
|
||||
"info", inst, hash32_ptr(inst->session));
|
||||
|
|
|
|||
Loading…
Reference in a new issue