Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a2e6a78 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: ope: Add debugfs support to dump ope hang dump" into camera-kernel.lnx.3.1

parents 508ceb1d b5fa90ce
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -588,6 +588,7 @@ static void cam_ope_dump_req_data(struct cam_ope_request *ope_req)
				ope_req->ope_debug_buf.offset);
		return;
	}

	dump = (struct cam_ope_hang_dump *)ope_req->ope_debug_buf.cpu_addr;
	memset(dump, 0, sizeof(struct cam_ope_hang_dump));
	dump->num_bufs = 0;
@@ -1545,6 +1546,7 @@ static void cam_ope_ctx_cdm_callback(uint32_t handle, void *userdata,
	struct cam_hw_done_event_data buf_data;
	struct timespec64 ts;
	bool flag = false;
	bool dump_flag = true;

	if (!userdata) {
		CAM_ERR(CAM_OPE, "Invalid ctx from CDM callback");
@@ -1604,12 +1606,17 @@ static void cam_ope_ctx_cdm_callback(uint32_t handle, void *userdata,
			 ope_req->request_id, ctx->ctx_id);
		CAM_ERR(CAM_OPE, "Rst of CDM and OPE for error reqid = %lld",
			ope_req->request_id);
		if (status != CAM_CDM_CB_STATUS_HW_FLUSH)
		if (status != CAM_CDM_CB_STATUS_HW_FLUSH) {
			cam_ope_dump_req_data(ope_req);
			dump_flag = false;
		}
		rc = cam_ope_mgr_reset_hw();
		flag = true;
	}

	if (ope_hw_mgr->dump_req_data_enable && dump_flag)
		cam_ope_dump_req_data(ope_req);

	ctx->req_cnt--;

	buf_data.request_id = ope_req->request_id;
@@ -3760,6 +3767,15 @@ static int cam_ope_create_debug_fs(void)
		goto err;
	}

	if (!debugfs_create_bool("dump_req_data_enable",
		0644,
		ope_hw_mgr->dentry,
		&ope_hw_mgr->dump_req_data_enable)) {
		CAM_ERR(CAM_OPE,
			"failed to create dump_enable_debug");
		goto err;
	}

	return 0;
err:
	debugfs_remove_recursive(ope_hw_mgr->dentry);
+4 −0
Original line number Diff line number Diff line
@@ -499,6 +499,9 @@ struct cam_ope_ctx {
 * @ope_dev_intf:      OPE device interface
 * @cdm_reg_map:       OPE CDM register map
 * @clk_info:          OPE clock Info for HW manager
 * @dentry:            Pointer to OPE debugfs directory
 * @frame_dump_enable: OPE frame setting dump enablement
 * @dump_req_data_enable: OPE hang dump enablement
 */
struct cam_ope_hw_mgr {
	int32_t             open_cnt;
@@ -531,6 +534,7 @@ struct cam_ope_hw_mgr {
	struct cam_ope_clk_info clk_info;
	struct dentry *dentry;
	bool   frame_dump_enable;
	bool   dump_req_data_enable;
};

/**