Browse Source

msm: camera: isp: Add support for bus info dump on PF

On PF based on the faulting client [IFE WR/SFE WR/SFE RD], invoke
the appropriate resource to dump it's info.

CRs-Fixed: 3079337
Change-Id: I0160fa9b29fca3991952370eb1fb37b667136bc4
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 3 years ago
parent
commit
7bf952210f

+ 4 - 0
drivers/cam_isp/cam_isp_context.c

@@ -958,6 +958,10 @@ static char *__cam_isp_ife_sfe_resource_handle_id_to_type(
 	case CAM_ISP_SFE_OUT_BAYER_RS_STATS_0:          return "SFE_RS_STATS_0";
 	case CAM_ISP_SFE_OUT_BAYER_RS_STATS_1:          return "SFE_RS_STATS_1";
 	case CAM_ISP_SFE_OUT_BAYER_RS_STATS_2:          return "SFE_RS_STATS_2";
+	/* SFE input ports */
+	case CAM_ISP_SFE_IN_RD_0:                       return "SFE_RD_0";
+	case CAM_ISP_SFE_IN_RD_1:                       return "SFE_RD_1";
+	case CAM_ISP_SFE_IN_RD_2:                       return "SFE_RD_2";
 	/* Handle invalid type */
 	default:                                        return "Invalid_Resource_Type";
 	}

+ 23 - 28
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -10971,13 +10971,25 @@ static void cam_ife_mgr_print_io_bufs(struct cam_ife_hw_mgr  *hw_mgr,
 		}
 }
 
-static void cam_ife_mgr_pf_dump(uint32_t res_id,
-	struct cam_ife_hw_mgr_ctx *ctx)
+static int cam_ife_hw_mgr_dump_bus_info(
+	uint32_t res_id,
+	struct cam_isp_hw_intf_data *hw_intf_data)
+{
+	struct cam_isp_hw_event_info event_info;
+
+	event_info.res_id = res_id;
+
+	return hw_intf_data->hw_intf->hw_ops.process_cmd(
+		hw_intf_data->hw_intf->hw_priv,
+		CAM_ISP_HW_CMD_DUMP_BUS_INFO,
+		&event_info, sizeof(struct cam_isp_hw_event_info));
+}
+
+static void cam_ife_mgr_pf_dump(
+	struct cam_ife_hw_mgr_ctx   *ctx)
 {
 	struct cam_isp_hw_mgr_res      *hw_mgr_res;
 	struct cam_hw_intf             *hw_intf;
-	struct cam_isp_hw_event_info    event_info;
-	uint32_t                        res_id_out;
 	int  i, rc = 0;
 
 	/* dump the registers  */
@@ -11010,29 +11022,6 @@ static void cam_ife_mgr_pf_dump(uint32_t res_id,
 				CAM_ERR(CAM_ISP, "NULL hw_intf!");
 		}
 	}
-
-	event_info.res_id = res_id;
-	res_id_out = res_id & 0xFF;
-
-	if (res_id_out >= max_ife_out_res) {
-		CAM_ERR(CAM_ISP, "Invalid out resource id :%x",
-			res_id);
-		return;
-	}
-
-	hw_mgr_res = &ctx->res_list_ife_out[res_id_out];
-	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));
-		}
-	}
 }
 
 static void cam_ife_mgr_pf_dump_mid_info(
@@ -11119,6 +11108,11 @@ static void cam_ife_mgr_dump_pf_data(
 					ctx->base[i].hw_type == CAM_ISP_HW_TYPE_VFE ? "VFE" : "SFE",
 					ctx->base[i].idx, hw_cmd_args->u.pf_args.pid);
 				cam_ife_mgr_pf_dump_mid_info(ctx, hw_cmd_args, hw_intf_data);
+
+				/* If MID found - dump client info */
+				if (ctx->flags.pf_mid_found)
+					cam_ife_hw_mgr_dump_bus_info(ctx->pf_info.out_port_id,
+						hw_intf_data);
 				break;
 			}
 		}
@@ -11131,7 +11125,8 @@ static void cam_ife_mgr_dump_pf_data(
 		CAM_INFO(CAM_ISP,
 			"This context does not cause pf:pid:%d ctx_id:%d",
 			hw_cmd_args->u.pf_args.pid, ctx->ctx_index);
-	cam_ife_mgr_pf_dump(ctx->pf_info.out_port_id, ctx);
+
+	cam_ife_mgr_pf_dump(ctx);
 
 outportlog:
 	cam_ife_mgr_print_io_bufs(hw_mgr, *resource_type, packet,

+ 4 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -5146,6 +5146,10 @@ static int cam_ife_csid_ver2_process_cmd(void *hw_priv,
 	case CAM_ISP_HW_CMD_RDI_LCR_CFG:
 		rc = cam_ife_csid_ver2_rdi_lcr_cfg(csid_hw, cmd_args);
 		break;
+	case CAM_IFE_CSID_LOG_ACQUIRE_DATA:
+		/* Not supported on ver2 */
+		rc = 0;
+		break;
 	default:
 		CAM_ERR(CAM_ISP, "CSID:%d unsupported cmd:%d",
 			csid_hw->hw_intf->hw_idx, cmd_type);

+ 12 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe680.h

@@ -946,6 +946,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_1,
 			.mid[0]        = 25,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 8,
 			.en_line_done  = 1,
@@ -957,6 +958,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_2,
 			.mid[0]        = 26,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 9,
 			.en_line_done  = 1,
@@ -968,6 +970,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_3,
 			.mid[0]        = 27,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 10,
 			.en_line_done  = 1,
@@ -979,6 +982,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_4,
 			.mid[0]        = 28,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 11,
 			.name          = "RDI_3",
@@ -989,6 +993,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_4,
 			.mid[0]        = 29,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 12,
 			.name          = "RDI_4",
@@ -1000,6 +1005,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 16,
 			.mid[1]        = 17,
+			.num_mid       = 2,
 			.num_wm        = 1,
 			.wm_idx        = 0,
 			.name          = "REMOSIAC",
@@ -1020,6 +1026,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 19,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 2,
 			.name          = "STATS_BE_0",
@@ -1030,6 +1037,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 20,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 3,
 			.name          = "STATS_BHIST_0",
@@ -1040,6 +1048,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 21,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 4,
 			.name          = "STATS_BE_1",
@@ -1050,6 +1059,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 22,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 5,
 			.name          = "STATS_BHIST_1",
@@ -1060,6 +1070,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 23,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 6,
 			.name          = "STATS_BE_2",
@@ -1070,6 +1081,7 @@ static struct cam_sfe_bus_wr_hw_info sfe680_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 24,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 7,
 			.name          = "STATS_BHIST_2",

+ 14 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe780.h

@@ -1293,6 +1293,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_1,
 			.mid[0]        = 45,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 11,
 			.en_line_done  = 1,
@@ -1304,6 +1305,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_2,
 			.mid[0]        = 46,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 12,
 			.en_line_done  = 1,
@@ -1315,6 +1317,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_3,
 			.mid[0]        = 47,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 13,
 			.en_line_done  = 1,
@@ -1326,6 +1329,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_4,
 			.mid[0]        = 48,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 14,
 			.name          = "RDI_3",
@@ -1336,6 +1340,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = -1,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_5,
 			.mid[0]        = 49,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 15,
 			.name          = "RDI_4",
@@ -1347,6 +1352,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 32,
 			.mid[1]        = 33,
+			.num_mid       = 2,
 			.num_wm        = 1,
 			.wm_idx        = 0,
 			.name          = "REMOSIAC",
@@ -1368,6 +1374,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 36,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 2,
 			.name          = "STATS_BE_0",
@@ -1378,6 +1385,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 37,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 3,
 			.name          = "STATS_BHIST_0",
@@ -1388,6 +1396,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 38,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 4,
 			.name          = "STATS_BE_1",
@@ -1398,6 +1407,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 39,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 5,
 			.name          = "STATS_BHIST_1",
@@ -1418,6 +1428,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 41,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 7,
 			.name          = "STATS_BHIST_2",
@@ -1428,6 +1439,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 42,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 8,
 			.name          = "STATS_RS_0",
@@ -1438,6 +1450,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 43,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 9,
 			.name          = "STATS_RS_1",
@@ -1448,6 +1461,7 @@ static struct cam_sfe_bus_wr_hw_info sfe780_bus_wr_hw_info = {
 			.max_height    = 5472,
 			.source_group  = CAM_SFE_BUS_WR_SRC_GRP_0,
 			.mid[0]        = 44,
+			.num_mid       = 1,
 			.num_wm        = 1,
 			.wm_idx        = 10,
 			.name          = "STATS_RS_2",

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_core.c

@@ -353,7 +353,7 @@ int cam_sfe_process_cmd(void *hw_priv, uint32_t cmd_type,
 			cmd_args, arg_size);
 		break;
 	case  CAM_ISP_HW_CMD_UNMASK_BUS_WR_IRQ:
-		/* Needs to be handled based on hw_mgr change */
+		/* Not supported */
 		break;
 	case CAM_ISP_HW_CMD_SET_SFE_DEBUG_CFG:
 		/* propagate to SFE top */
@@ -361,6 +361,7 @@ int cam_sfe_process_cmd(void *hw_priv, uint32_t cmd_type,
 			core_info->sfe_top->top_priv, cmd_type,
 			cmd_args, arg_size);
 	case CAM_ISP_HW_CMD_GET_RES_FOR_MID:
+	case CAM_ISP_HW_CMD_DUMP_BUS_INFO:
 		/* propagate to SFE bus wr */
 		core_info->sfe_bus_wr->hw_ops.process_cmd(
 			core_info->sfe_bus_wr->bus_priv, cmd_type,

+ 53 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_rd.c

@@ -367,6 +367,36 @@ static int cam_sfe_bus_rd_handle_irq(
 	return (rc == IRQ_HANDLED) ? 0 : -EINVAL;
 }
 
+static int cam_sfe_bus_rd_print_dimensions(
+	enum cam_sfe_bus_rd_type     bus_rd_res_id,
+	struct cam_sfe_bus_rd_priv  *bus_rd_priv)
+{
+	int i;
+	struct cam_isp_resource_node           *rsrc_node = NULL;
+	struct cam_sfe_bus_rd_data             *rsrc_data = NULL;
+	struct cam_sfe_bus_rd_rm_resource_data *rm_data;
+	struct cam_sfe_bus_rd_common_data      *common_data;
+
+	rsrc_node = &bus_rd_priv->sfe_bus_rd[bus_rd_res_id];
+	rsrc_data = rsrc_node->res_priv;
+
+	for (i = 0; i < rsrc_data->num_rm; i++) {
+		rm_data = rsrc_data->rm_res[i]->res_priv;
+
+		if (!rm_data)
+			continue;
+
+		common_data = rm_data->common_data;
+		CAM_INFO(CAM_SFE,
+			"SFE: %u RD: %u res_id: 0x%x width: 0x%x height: 0x%x stride: 0x%x unpacker: 0x%x addr: 0x%x",
+			bus_rd_priv->common_data.core_index, i, rsrc_node->res_id,
+			rm_data->width, rm_data->height, rm_data->stride, rm_data->unpacker_cfg,
+			cam_io_r_mb(common_data->mem_base + rm_data->hw_regs->image_addr));
+	}
+
+	return 0;
+}
+
 static int cam_sfe_bus_acquire_rm(
 	struct cam_sfe_bus_rd_priv             *bus_rd_priv,
 	void                                   *tasklet,
@@ -1556,12 +1586,12 @@ static int cam_sfe_bus_rd_get_res_for_mid(
 	 * Correct value will be dumped in hw mgr
 	 */
 	if (i == bus_priv->num_bus_rd_resc) {
-		CAM_INFO(CAM_SFE, "mid:%d does not match with any out resource", get_res->mid);
+		CAM_INFO(CAM_SFE, "mid:%d does not match with any read resource", get_res->mid);
 		return 0;
 	}
 
 end:
-	CAM_INFO(CAM_SFE, "match mid :%d  out resource: 0x%x found",
+	CAM_INFO(CAM_SFE, "match mid :%d  read resource: 0x%x found",
 		get_res->mid, bus_priv->sfe_bus_rd[i].res_id);
 	get_res->out_res_id = bus_priv->sfe_bus_rd[i].res_id;
 	return 0;
@@ -1714,6 +1744,27 @@ static int cam_sfe_bus_rd_process_cmd(
 	case CAM_ISP_HW_CMD_GET_RES_FOR_MID:
 		rc = cam_sfe_bus_rd_get_res_for_mid(priv, cmd_args, arg_size);
 		break;
+	case CAM_ISP_HW_CMD_DUMP_BUS_INFO: {
+		struct cam_isp_hw_event_info  *event_info =
+			(struct cam_isp_hw_event_info *)cmd_args;
+		enum cam_sfe_bus_rd_type       bus_rd_res_id;
+
+		bus_rd_res_id = cam_sfe_bus_get_bus_rd_res_id(
+			event_info->res_id);
+
+		/* Skip if it's not a read resource */
+		if (bus_rd_res_id == CAM_SFE_BUS_RD_MAX) {
+			CAM_DBG(CAM_SFE,
+				"Not a SFE read res: 0x%x - skip dump",
+				event_info->res_id);
+			rc = 0;
+			break;
+		}
+
+		rc = cam_sfe_bus_rd_print_dimensions(bus_rd_res_id,
+			(struct cam_sfe_bus_rd_priv  *)priv);
+		break;
+	}
 	default:
 		CAM_ERR_RATE_LIMIT(CAM_SFE,
 			"Invalid SFE BUS RD command type: %d",

+ 32 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_wr.c

@@ -2010,13 +2010,29 @@ static int cam_sfe_bus_deinit_sfe_out_resource(
 static inline void __cam_sfe_bus_wr_print_wm_info(
 	struct cam_sfe_bus_wr_wm_resource_data  *wm_data)
 {
+	uint32_t addr_status0, addr_status1, addr_status2, addr_status3;
+
+	addr_status0 = cam_io_r_mb(wm_data->common_data->mem_base +
+		wm_data->hw_regs->addr_status_0);
+	addr_status1 = cam_io_r_mb(wm_data->common_data->mem_base +
+		wm_data->hw_regs->addr_status_1);
+	addr_status2 = cam_io_r_mb(wm_data->common_data->mem_base +
+		wm_data->hw_regs->addr_status_2);
+	addr_status3 = cam_io_r_mb(wm_data->common_data->mem_base +
+		wm_data->hw_regs->addr_status_3);
+
 	CAM_INFO(CAM_SFE,
-		"SFE:%d WM:%d width:%u height:%u stride:%u x_init:%u en_cfg:%u acquired width:%u height:%u pack_cfg: 0x%x",
+		"SFE:%u WM:%u width:%u height:%u stride:%u x_init:%u en_cfg:%u acquired width:%u height:%u pack_cfg: 0x%x",
 		wm_data->common_data->core_index, wm_data->index,
 		wm_data->width, wm_data->height,
 		wm_data->stride, wm_data->h_init,
 		wm_data->en_cfg, wm_data->acquired_width,
 		wm_data->acquired_height, wm_data->pack_fmt);
+
+	CAM_INFO(CAM_SFE,
+		"SFE:%u WM:%u last_consumed_image_addr:0x%x last_consumed_frame_header:0x%x fifo_word_cnt:0x%x [FH + Image] current_image_addr:0x%x",
+		wm_data->common_data->hw_intf->hw_idx, wm_data->index,
+		addr_status0, addr_status1, addr_status2, addr_status3);
 }
 
 static int cam_sfe_bus_wr_print_dimensions(
@@ -2996,7 +3012,7 @@ static int cam_sfe_bus_wr_get_res_for_mid(
 
 	for (i = 0; i < bus_priv->num_out; i++) {
 
-		for (j = 0; j < CAM_SFE_BUS_MAX_MID_PER_PORT; j++) {
+		for (j = 0; j < bus_priv->sfe_out_hw_info[i].num_mid; j++) {
 			if (bus_priv->sfe_out_hw_info[i].mid[j] == get_res->mid)
 				goto end;
 		}
@@ -3137,18 +3153,26 @@ static int cam_sfe_bus_wr_process_cmd(
 		rc = 0;
 		break;
 	case CAM_ISP_HW_CMD_DUMP_BUS_INFO: {
-		struct cam_isp_hw_event_info  *event_info;
+		struct cam_isp_hw_event_info  *event_info =
+			(struct cam_isp_hw_event_info *)cmd_args;
 		enum cam_sfe_bus_sfe_out_type  sfe_out_res_id;
 
-		event_info =
-			(struct cam_isp_hw_event_info *)cmd_args;
-		bus_priv = (struct cam_sfe_bus_wr_priv  *) priv;
 		sfe_out_res_id =
 			cam_sfe_bus_wr_get_out_res_id(event_info->res_id);
+
+		/* Skip if not write resource */
+		if (sfe_out_res_id == CAM_SFE_BUS_SFE_OUT_MAX) {
+			CAM_DBG(CAM_SFE,
+				"No a SFE write res: 0x%x - skip dump",
+				event_info->res_id);
+			rc = 0;
+			break;
+		}
+
 		rc = cam_sfe_bus_wr_print_dimensions(
-			sfe_out_res_id, bus_priv);
+			sfe_out_res_id, (struct cam_sfe_bus_wr_priv  *)priv);
 		break;
-		}
+	}
 	case CAM_ISP_HW_CMD_WM_CONFIG_UPDATE:
 		rc = cam_sfe_bus_wr_update_wm_config(cmd_args);
 		break;

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_wr.h

@@ -136,6 +136,7 @@ struct cam_sfe_bus_sfe_out_hw_info {
 	uint32_t                            max_height;
 	uint32_t                            source_group;
 	uint32_t                            mid[CAM_SFE_BUS_MAX_MID_PER_PORT];
+	uint32_t                            num_mid;
 	uint32_t                            num_wm;
 	uint32_t                            wm_idx;
 	uint32_t                            en_line_done;