瀏覽代碼

msm: vidc: Initialize queues before adding session to core

Initialize queues first and then add the session
to the core. This will avoid the access to uninitialized
queues of new instance while voting the clocks/buses of the
other instance.

Change-Id: I92b06dba361eb1539aced90fb58251c04a55b175
Manikanta Kanamarlapudi 4 年之前
父節點
當前提交
59e44ef2fa
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      driver/vidc/src/msm_vidc.c

+ 5 - 5
driver/vidc/src/msm_vidc.c

@@ -713,11 +713,6 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
 	kref_init(&inst->kref);
 	mutex_init(&inst->lock);
 
-	rc = msm_vidc_add_session(inst);
-	if (rc) {
-		d_vpr_e("%s: failed to get session id\n", __func__);
-		goto error;
-	}
 	i_vpr_e(inst, "Opening video instance: %d\n", session_type);
 
 	inst->response_workq = create_singlethread_workqueue("response_workq");
@@ -796,6 +791,11 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
 	if (rc)
 		goto error;
 
+	rc = msm_vidc_add_session(inst);
+	if (rc) {
+		d_vpr_e("%s: failed to get session id\n", __func__);
+		goto error;
+	}
 	msm_vidc_scale_power(inst, true);
 
 	rc = msm_vidc_session_open(inst);