Эх сурвалжийг харах

msm: camera: isp: Add rd info for SFE hw dump

This change adds rd info for SFE hw dump. Also when an SFE error
occurs, only the information of err res will be dump, it will
help on reducing burdensome logs.

CRs-Fixed: 3436435
Change-Id: I7e3395d8301e2a51cbaf62d3974f37468ffa785b
Signed-off-by: Stark Lin <[email protected]>
Stark Lin 2 жил өмнө
parent
commit
54cb878ad5

+ 35 - 27
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -13904,26 +13904,46 @@ static int cam_ife_hw_mgr_handle_sfe_hw_dump_info(
 	struct cam_isp_hw_event_info  *event_info =
 		(struct cam_isp_hw_event_info *)evt_info;
 	struct cam_isp_hw_mgr_res     *hw_mgr_res = NULL;
+	struct cam_isp_resource_node  *rsrc_node = NULL;
 	struct cam_hw_intf            *hw_intf;
 	uint32_t i, out_port_id;
 	int rc = 0;
 
-	out_port_id = event_info->res_id & 0xFF;
-	hw_mgr_res =
-		&ife_hw_mgr_ctx->res_list_sfe_out[out_port_id];
-	for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
-		if (!hw_mgr_res->hw_res[i])
-			continue;
-		hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
-		if (hw_intf->hw_ops.process_cmd) {
-			rc = hw_intf->hw_ops.process_cmd(
-				hw_intf->hw_priv,
-				CAM_ISP_HW_CMD_DUMP_BUS_INFO,
-				(void *)event_info,
-				sizeof(struct cam_isp_hw_event_info));
+	/* SFE in rd resources */
+	list_for_each_entry(hw_mgr_res,
+		&ife_hw_mgr_ctx->res_list_ife_in_rd, list) {
+		for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
+			if (!hw_mgr_res->hw_res[i])
+				continue;
+			rsrc_node = hw_mgr_res->hw_res[i];
+			if ((event_info->res_type == CAM_ISP_RESOURCE_SFE_RD) &&
+				(rsrc_node->res_type == CAM_ISP_RESOURCE_SFE_RD) &&
+				(event_info->res_id == rsrc_node->res_id)) {
+				hw_intf = rsrc_node->hw_intf;
+				if (hw_intf && hw_intf->hw_ops.process_cmd)
+					rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv,
+						CAM_ISP_HW_CMD_DUMP_BUS_INFO, (void *)event_info,
+						sizeof(struct cam_isp_hw_event_info));
+			}
 		}
 	}
 
+	/* SFE out resources */
+	if (event_info->res_type == CAM_ISP_RESOURCE_SFE_OUT) {
+		out_port_id = event_info->res_id & 0xFF;
+		hw_mgr_res =
+			&ife_hw_mgr_ctx->res_list_sfe_out[out_port_id];
+		for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
+			if (!hw_mgr_res->hw_res[i])
+				continue;
+			hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
+			if (hw_intf->hw_ops.process_cmd) {
+				rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv,
+					CAM_ISP_HW_CMD_DUMP_BUS_INFO, (void *)event_info,
+					sizeof(struct cam_isp_hw_event_info));
+			}
+		}
+	}
 	return rc;
 }
 
@@ -14014,7 +14034,6 @@ static int cam_ife_hw_mgr_handle_sfe_hw_err(
 	struct cam_isp_hw_error_event_info     *err_evt_info;
 	struct cam_isp_hw_error_event_data      error_event_data = {0};
 	struct cam_ife_hw_event_recovery_data   recovery_data = {0};
-	uint32_t i;
 
 	if (!event_info->event_data) {
 		CAM_ERR(CAM_ISP,
@@ -14030,19 +14049,8 @@ static int cam_ife_hw_mgr_handle_sfe_hw_err(
 		event_info->res_type, ctx->ctx_index);
 
 	spin_lock(&g_ife_hw_mgr.ctx_lock);
-	/* Dump SFE BUS info */
-	if (event_info->res_type == CAM_ISP_RESOURCE_SFE_RD) {
-		for (i = CAM_ISP_SFE_IN_RD_0; i < CAM_ISP_SFE_IN_RES_MAX; i++) {
-			event_info->res_id = i;
-			cam_ife_hw_mgr_handle_sfe_hw_dump_info(ctx, event_info);
-		}
-	} else if (event_info->res_type == CAM_ISP_RESOURCE_SFE_OUT) {
-		for (i = CAM_ISP_SFE_OUT_RES_RDI_0;
-			i <= CAM_ISP_SFE_OUT_HDR_STATS; i++) {
-			event_info->res_id = i;
-			cam_ife_hw_mgr_handle_sfe_hw_dump_info(ctx, event_info);
-		}
-	}
+
+	cam_ife_hw_mgr_handle_sfe_hw_dump_info(ctx, event_info);
 
 	/* Only report error to userspace */
 	if (err_evt_info->err_type & CAM_SFE_IRQ_STATUS_VIOLATION) {