浏览代码

eva-kernel: hfi q info at session timeout

           Printing hfi q info at the of
           session queue time out to get debug
           info on missed cmd/frame pkt.

Change-Id: I9b324a6496699272f9f1b9cb794f3e322d5421ae
Signed-off-by: Nagesh Gunna <[email protected]>
Nagesh Gunna 2 年之前
父节点
当前提交
79c9987bbe
共有 4 个文件被更改,包括 25 次插入18 次删除
  1. 4 4
      msm/eva/cvp_hfi.c
  2. 1 1
      msm/eva/cvp_hfi_api.h
  3. 4 1
      msm/eva/msm_cvp.c
  4. 16 12
      msm/eva/msm_cvp_common.c

+ 4 - 4
msm/eva/cvp_hfi.c

@@ -1177,10 +1177,6 @@ static void cvp_dump_csr(struct iris_hfi_device *dev)
 	dprintk(CVP_ERR, "CVP_WRAPPER_CPU_STATUS: %x\n", reg);
 	reg = __read_register(dev, CVP_CPU_CS_SCIACMDARG0);
 	dprintk(CVP_ERR, "CVP_CPU_CS_SCIACMDARG0: %x\n", reg);
-	reg = __read_register(dev, CVP_WRAPPER_CPU_CLOCK_CONFIG);
-	dprintk(CVP_ERR, "CVP_WRAPPER_CPU_CLOCK_CONFIG: %x\n", reg);
-	reg = __read_register(dev, CVP_WRAPPER_CORE_CLOCK_CONFIG);
-	dprintk(CVP_ERR, "CVP_WRAPPER_CORE_CLOCK_CONFIG: %x\n", reg);
 	reg = __read_register(dev, CVP_WRAPPER_INTR_STATUS);
 	dprintk(CVP_ERR, "CVP_WRAPPER_INTR_STATUS: %x\n", reg);
 	reg = __read_register(dev, CVP_CPU_CS_H2ASOFTINT);
@@ -1191,6 +1187,10 @@ static void cvp_dump_csr(struct iris_hfi_device *dev)
 	dprintk(CVP_ERR, "CVP_CC_MVS1C_GDSCR: %x\n", reg);
 	reg = __read_register(dev, CVP_CC_MVS1C_CBCR);
 	dprintk(CVP_ERR, "CVP_CC_MVS1C_CBCR: %x\n", reg);
+	reg = __read_register(dev, CVP_WRAPPER_CPU_CLOCK_CONFIG);
+	dprintk(CVP_ERR, "CVP_WRAPPER_CPU_CLOCK_CONFIG: %x\n", reg);
+	reg = __read_register(dev, CVP_WRAPPER_CORE_CLOCK_CONFIG);
+	dprintk(CVP_ERR, "CVP_WRAPPER_CORE_CLOCK_CONFIG: %x\n", reg);
 	dev->reg_dumped = true;
 }
 

+ 1 - 1
msm/eva/cvp_hfi_api.h

@@ -311,5 +311,5 @@ unsigned int get_msg_errorcode(void *msg);
 int get_msg_opconfigs(void *msg, unsigned int *session_id,
 		unsigned int *error_type, unsigned int *config_id);
 extern const struct msm_cvp_hfi_defs cvp_hfi_defs[MAX_PKT_IDX];
-
+void print_hfi_queue_info(struct cvp_hfi_device *hdev);
 #endif /*__CVP_HFI_API_H__ */

+ 4 - 1
msm/eva/msm_cvp.c

@@ -9,7 +9,7 @@
 #include "msm_cvp_buf.h"
 #include "cvp_comm_def.h"
 #include "cvp_power.h"
-
+#include "cvp_hfi_api.h"
 static int cvp_enqueue_pkt(struct msm_cvp_inst* inst,
 	struct eva_kmd_hfi_packet *in_pkt,
 	unsigned int in_offset,
@@ -94,6 +94,9 @@ static int cvp_wait_process_message(struct msm_cvp_inst *inst,
 	if (wait_event_timeout(sq->wq,
 		cvp_msg_pending(sq, &msg, ktid), timeout) == 0) {
 		dprintk(CVP_WARN, "session queue wait timeout\n");
+		if(inst && inst->core && inst->core->device){
+			print_hfi_queue_info(inst->core->device);
+		}
 		rc = -ETIMEDOUT;
 		goto exit;
 	}

+ 16 - 12
msm/eva/msm_cvp_common.c

@@ -58,16 +58,26 @@ static void dump_hfi_queue(struct iris_hfi_device *device)
 			read_ptr = (u32 *)((qinfo->q_array.align_virtual_addr) +
 				(read_idx << 2));
 			dprintk(CVP_ERR,
-				"queue payload: %x %x %x %x %x %x %x %x\n",
+				"queue payload: %x %x %x %x %x %x %x %x %x\n",
 				read_ptr[0], read_ptr[1], read_ptr[2],
 				read_ptr[3], read_ptr[4], read_ptr[5],
-				read_ptr[6], read_ptr[7]);
+				read_ptr[6], read_ptr[7], read_ptr[8]);
 		}
 
 	}
 	mutex_unlock(&device->lock);
 }
 
+void print_hfi_queue_info(struct cvp_hfi_device *hdev)
+{
+       if(hdev && hdev->hfi_device_data){
+		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
+		dump_hfi_queue(hdev->hfi_device_data);
+       }
+}
+
+
+
 struct msm_cvp_core *get_cvp_core(int core_id)
 {
 	struct msm_cvp_core *core;
@@ -378,8 +388,7 @@ int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
 	if (!rc) {
 		dprintk(CVP_WARN, "Wait interrupted or timed out: %d\n",
 				SESSION_MSG_INDEX(cmd));
-		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
-		dump_hfi_queue(hdev->hfi_device_data);
+		print_hfi_queue_info(hdev);
 		rc = -ETIMEDOUT;
 	} else if (inst->state == MSM_CVP_CORE_INVALID) {
 		rc = -ECONNRESET;
@@ -862,8 +871,7 @@ static int msm_comm_session_abort(struct msm_cvp_inst *inst)
 	if (!rc) {
 		dprintk(CVP_ERR, "%s: inst %pK session %x abort timed out\n",
 				__func__, inst, hash32_ptr(inst->session));
-		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
-		dump_hfi_queue(hdev->hfi_device_data);
+		print_hfi_queue_info(hdev);
 		msm_cvp_comm_generate_sys_error(inst);
 		rc = -EBUSY;
 	} else {
@@ -947,8 +955,7 @@ int msm_cvp_comm_check_core_init(struct msm_cvp_core *core)
 		dprintk(CVP_ERR, "%s: Wait interrupted or timed out: %d\n",
 				__func__, SYS_MSG_INDEX(HAL_SYS_INIT_DONE));
 		hdev = core->device;
-		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
-		dump_hfi_queue(hdev->hfi_device_data);
+		print_hfi_queue_info(hdev);
 		rc = -EIO;
 		goto exit;
 	} else {
@@ -1336,10 +1343,7 @@ void msm_cvp_ssr_handler(struct work_struct *work)
 			s = cvp_get_inst_validate(inst->core, inst);
 			if (!s)
 				return;
-
-			call_hfi_op(hdev, flush_debug_queue,
-				hdev->hfi_device_data);
-			dump_hfi_queue(hdev->hfi_device_data);
+			print_hfi_queue_info(hdev);
 			msm_cvp_comm_kill_session(inst);
 			cvp_put_inst(s);
 		} else {