浏览代码

msm: eva: Define kernel timeout in one place

Easy to maintain.

Change-Id: Iacf8ae5481c08d69259f41db26ac6ac2216a54f6
Signed-off-by: George Shen <[email protected]>
George Shen 2 年之前
父节点
当前提交
84334be2a1
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 6 3
      msm/eva/msm_cvp.c
  2. 0 1
      msm/eva/msm_cvp_internal.h

+ 6 - 3
msm/eva/msm_cvp.c

@@ -149,7 +149,8 @@ static int msm_cvp_session_receive_hfi(struct msm_cvp_inst *inst,
 	if (!s)
 		return -ECONNRESET;
 
-	wait_time = msecs_to_jiffies(CVP_MAX_WAIT_TIME);
+	wait_time = msecs_to_jiffies(
+		inst->core->resources.msm_cvp_hw_rsp_timeout);
 	sq = &inst->session_queue;
 
 	rc = cvp_wait_process_message(inst, sq, NULL, wait_time, out_pkt);
@@ -332,7 +333,8 @@ static int cvp_fence_proc(struct msm_cvp_inst *inst,
 		goto exit;
 	}
 
-	timeout = msecs_to_jiffies(CVP_MAX_WAIT_TIME);
+	timeout = msecs_to_jiffies(
+			inst->core->resources.msm_cvp_hw_rsp_timeout);
 	rc = cvp_wait_process_message(inst, sq, &ktid, timeout,
 				(struct eva_kmd_hfi_packet *)&hdr);
 
@@ -1407,7 +1409,8 @@ static int cvp_drain_fence_sched_list(struct msm_cvp_inst *inst)
 		++count;
 	}
 	mutex_unlock(&q->lock);
-	wait_time = count * CVP_MAX_WAIT_TIME * 1000;
+	wait_time = count * 1000;
+	wait_time *= inst->core->resources.msm_cvp_hw_rsp_timeout;
 
 	dprintk(CVP_SYNX, "%s: wait %d us for %d fence command\n",
 			__func__, wait_time, count);

+ 0 - 1
msm/eva/msm_cvp_internal.h

@@ -199,7 +199,6 @@ enum msm_cvp_modes {
 };
 
 #define MAX_NUM_MSGS_PER_SESSION	128
-#define CVP_MAX_WAIT_TIME	2000
 
 struct cvp_session_msg {
 	struct list_head node;