소스 검색

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);