Ver código fonte

msm: camera: cdm: Add CDM Dump Functionality

Add CDM core registers dump functionality for
the scenariors where the cdm reset timesout and
the workqueue is delayed.

CRs-Fixed: 3130212
Change-Id: Ib79bb24164c77082eacfbecd14795b726bb14201
Signed-off-by: Jigar Agrawal <[email protected]>
Jigar Agrawal 3 anos atrás
pai
commit
3e365bafda

+ 7 - 1
drivers/cam_cdm/cam_cdm_hw_core.c

@@ -309,7 +309,10 @@ static void cam_hw_cdm_dump_bl_fifo_data(struct cam_hw_info *cdm_hw)
 void cam_hw_cdm_dump_core_debug_registers(struct cam_hw_info *cdm_hw,
 	bool pause_core)
 {
-	uint32_t dump_reg[4], core_dbg = 0x100;
+	uint32_t dump_reg[4];
+	uint32_t core_dbg = CAM_CDM_CORE_DBG_TEST_BUS_EN_MASK |
+		CAM_CDM_CORE_DBG_LOG_AHB_MASK |
+		CAM_CDM_CORE_DBG_FIFO_RB_EN_MASK;
 	uint32_t cdm_version = 0;
 	int i;
 	bool is_core_paused_already;
@@ -1691,9 +1694,12 @@ int cam_hw_cdm_reset_hw(struct cam_hw_info *cdm_hw, uint32_t handle)
 
 	if (time_left <= 0) {
 		rc = -ETIMEDOUT;
+
 		CAM_ERR(CAM_CDM, "%s%u HW reset Wait failed rc=%d",
 			soc_info->label_name,
 			soc_info->index, rc);
+
+		cam_hw_cdm_dump_core_debug_registers(cdm_hw, false);
 		goto end;
 	}
 

+ 5 - 2
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -5928,7 +5928,7 @@ static int cam_isp_blob_bw_update(
 static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
 					void *config_hw_args)
 {
-	int rc = -1, i, skip = 0;
+	int rc, i, skip = 0;
 	struct cam_hw_config_args *cfg;
 	struct cam_hw_update_entry *cmd;
 	struct cam_cdm_bl_request *cdm_cmd;
@@ -6131,8 +6131,11 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
 				CAM_ERR(CAM_ISP,
 					"config done completion timeout for req_id=%llu ctx_index %d",
 					cfg->request_id, ctx->ctx_index);
-				if (!cam_cdm_detect_hang_error(ctx->cdm_handle))
+
+				if (!cam_cdm_detect_hang_error(ctx->cdm_handle)) {
 					CAM_ERR(CAM_ISP, "CDM Workqueue delayed");
+					cam_cdm_dump_debug_registers(ctx->cdm_handle);
+				}
 
 				rc = -ETIMEDOUT;
 			} else {