Explorar o código

msm: camera: common: LDAR Dump Changes/Fixes

Separated ISP register dump from LDAR dump, fixed issue where LDAR dump
would fail if no active requests found, removed excessive logging function
call in ISP state monitor dump, fixed pending request/applied request dump
order to match tags in context utils, added more info from ISP stream.

CRs-Fixed: 3142549
Change-Id: Iaf25c0313714b5a776e3db81c11e96c7762d0f6e
Signed-off-by: Joshua Florez <[email protected]>
Joshua Florez %!s(int64=3) %!d(string=hai) anos
pai
achega
b31c24849c

+ 8 - 3
drivers/cam_core/cam_context_utils.c

@@ -1285,8 +1285,9 @@ static int cam_context_user_dump(struct cam_context *ctx,
 		CAM_ERR(CAM_CTXT, "[%s][%d] no active request",
 			ctx->dev_name, ctx->ctx_id);
 		spin_unlock_bh(&ctx->lock);
-		return -EIO;
+		return 0;
 	}
+
 	req = list_first_entry(&ctx->active_req_list,
 		struct cam_ctx_request, list);
 	spin_unlock_bh(&ctx->lock);
@@ -1298,6 +1299,7 @@ static int cam_context_user_dump(struct cam_context *ctx,
 			dump_args->buf_handle, rc);
 		return rc;
 	}
+
 	if (dump_args->offset >= buf_len) {
 		CAM_WARN(CAM_CTXT, "dump buffer overshoot offset %zu len %zu",
 			dump_args->offset, buf_len);
@@ -1344,10 +1346,11 @@ static int cam_context_user_dump(struct cam_context *ctx,
 	addr = (uint64_t *)(dst + sizeof(struct cam_context_dump_header));
 	start = addr;
 	if (!list_empty(&ctx->wait_req_list)) {
-		list_for_each_entry_safe(req, req_temp, &ctx->wait_req_list, list) {
+		list_for_each_entry_safe(req, req_temp, &ctx->pending_req_list, list) {
 			*addr++ = req->request_id;
 		}
 	}
+
 	hdr->size = hdr->word_size * (addr - start);
 	dump_args->offset += hdr->size +
 		sizeof(struct cam_context_dump_header);
@@ -1361,10 +1364,11 @@ static int cam_context_user_dump(struct cam_context *ctx,
 	addr = (uint64_t *)(dst + sizeof(struct cam_context_dump_header));
 	start = addr;
 	if (!list_empty(&ctx->pending_req_list)) {
-		list_for_each_entry_safe(req, req_temp, &ctx->pending_req_list, list) {
+		list_for_each_entry_safe(req, req_temp, &ctx->wait_req_list, list) {
 			*addr++ = req->request_id;
 		}
 	}
+
 	hdr->size = hdr->word_size * (addr - start);
 	dump_args->offset += hdr->size +
 		sizeof(struct cam_context_dump_header);
@@ -1382,6 +1386,7 @@ static int cam_context_user_dump(struct cam_context *ctx,
 			*addr++ = req->request_id;
 		}
 	}
+
 	hdr->size = hdr->word_size * (addr - start);
 	dump_args->offset += hdr->size +
 		sizeof(struct cam_context_dump_header);

+ 11 - 1
drivers/cam_isp/cam_isp_context.c

@@ -549,7 +549,6 @@ static int __cam_isp_ctx_user_dump_state_monitor_array(
 		"Dumping state information for preceding requests");
 
 	index = oldest_entry;
-	__cam_isp_ctx_dump_state_monitor_array(ctx_isp);
 	for (i = 0; i < num_entries; i++) {
 
 		rc = cam_common_user_dump_helper(dump_args,
@@ -4474,9 +4473,20 @@ static void *cam_isp_ctx_user_dump_stream_info(
 	*addr++ = ctx->ctx_id;
 	*addr++ = ctx->dev_hdl;
 	*addr++ = ctx->link_hdl;
+
+	*addr++ = hw_mgr_ctx->flags.is_dual;
+	*addr++ = hw_mgr_ctx->ctx_type;
+
 	*addr++ = hw_idx[CAM_ISP_HW_SPLIT_LEFT];
+	*addr++ = hw_idx[CAM_ISP_HW_SPLIT_RIGHT];
 	*addr++ = sfe_hw_idx[CAM_ISP_HW_SPLIT_LEFT];
+	*addr++ = sfe_hw_idx[CAM_ISP_HW_SPLIT_RIGHT];
+
 	*addr++ = hw_mgr_ctx->flags.is_sfe_shdr;
+	*addr++ = hw_mgr_ctx->flags.is_sfe_fs;
+	*addr++ = hw_mgr_ctx->flags.dsp_enabled;
+	*addr++ = hw_mgr_ctx->flags.is_offline;
+
 
 	return addr;
 }

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

@@ -11893,7 +11893,6 @@ static int cam_ife_mgr_user_dump_hw(
 		struct cam_hw_dump_args *dump_args)
 {
 	int rc = 0;
-	struct cam_hw_soc_dump_args soc_dump_args;
 
 	if (!ife_ctx || !dump_args) {
 		CAM_ERR(CAM_ISP, "Invalid parameters %pK %pK",
@@ -11901,16 +11900,13 @@ static int cam_ife_mgr_user_dump_hw(
 		rc = -EINVAL;
 		goto end;
 	}
-	soc_dump_args.buf_handle = dump_args->buf_handle;
-	soc_dump_args.request_id = dump_args->request_id;
-	soc_dump_args.offset = dump_args->offset;
 
 	rc = cam_ife_mgr_handle_reg_dump(ife_ctx,
 		ife_ctx->reg_dump_buf_desc,
 		ife_ctx->num_reg_dump_buf,
 		CAM_ISP_PACKET_META_REG_DUMP_ON_ERROR,
-		&soc_dump_args,
-		true);
+		NULL,
+		false);
 	if (rc) {
 		CAM_ERR(CAM_ISP,
 			"Dump failed req: %lld handle %u offset %u",
@@ -11919,7 +11915,7 @@ static int cam_ife_mgr_user_dump_hw(
 			dump_args->offset);
 		goto end;
 	}
-	dump_args->offset = soc_dump_args.offset;
+
 end:
 	return rc;
 }
@@ -11947,9 +11943,9 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args)
 	 * is already submitted with the hw manager. In this case, we
 	 * can dump just the related registers and skip going to core files.
 	 */
-	if (ife_ctx->num_reg_dump_buf) {
+	if (!ife_ctx->flags.dump_on_error) {
 		cam_ife_mgr_user_dump_hw(ife_ctx, dump_args);
-		return rc;
+		ife_ctx->flags.dump_on_error = true;
 	}
 
 	rc  = cam_mem_get_cpu_buf(dump_args->buf_handle,