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

Commit 363894c0 authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: camera: ope: Dump stripe info at the time of hang



Add logic to dump stripe info and wait event status at the
time of cdm hang.

CRs-Fixed: 2878214
Change-Id: Ib9892b0273e4436988c5f1384d18d60d29529c94
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent 51f76262
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/delay.h>
@@ -416,6 +416,17 @@ void cam_hw_cdm_dump_core_debug_registers(struct cam_hw_info *cdm_hw,
	CAM_INFO(CAM_CDM, "curr BL base 0x%x AHB base 0x%x",
		dump_reg[0], dump_reg[1]);

	cam_cdm_read_hw_reg(cdm_hw,
		core->offsets->cmn_reg->wait_status, &dump_reg[0]);
	cam_cdm_read_hw_reg(cdm_hw,
		core->offsets->cmn_reg->comp_wait[0]->comp_wait_status,
		&dump_reg[1]);
	cam_cdm_read_hw_reg(cdm_hw,
		core->offsets->cmn_reg->comp_wait[1]->comp_wait_status,
		&dump_reg[2]);
	CAM_INFO(CAM_CDM, "wait status 0x%x comp wait status 0x%x: 0x%x",
		dump_reg[0], dump_reg[1], dump_reg[2]);

	cam_cdm_read_hw_reg(cdm_hw,
		core->offsets->cmn_reg->current_bl_len, &dump_reg[0]);
	CAM_INFO(CAM_CDM,
+9 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/uaccess.h>
@@ -705,6 +705,7 @@ static int32_t cam_ope_process_request_timer(void *priv, void *data)
				hw_mgr->ope_dev_intf[i]->hw_priv,
				OPE_HW_DUMP_DEBUG,
				NULL, 0);

		task = cam_req_mgr_workq_get_task(ope_hw_mgr->msg_work);
		if (!task) {
			CAM_ERR(CAM_OPE, "no empty task");
@@ -1602,6 +1603,7 @@ static void cam_ope_ctx_cdm_callback(uint32_t handle, void *userdata,
	struct timespec64 ts;
	uint32_t evt_id = CAM_CTX_EVT_ID_SUCCESS;
	bool dump_flag = true;
	int i;

	if (!userdata) {
		CAM_ERR(CAM_OPE, "Invalid ctx from CDM callback");
@@ -1663,9 +1665,15 @@ static void cam_ope_ctx_cdm_callback(uint32_t handle, void *userdata,
			 ope_req->request_id, ctx->ctx_id);
		CAM_INFO(CAM_OPE, "Rst of CDM and OPE for error reqid = %lld",
			ope_req->request_id);

		if (status != CAM_CDM_CB_STATUS_HW_FLUSH) {
			cam_ope_dump_req_data(ope_req);
			dump_flag = false;

			CAM_INFO(CAM_OPE, "bach_size: %d", ctx->req_list[cookie]->num_batch);
			for (i = 0; i < ctx->req_list[cookie]->num_batch; i++)
				CAM_INFO(CAM_OPE, "i: %d num_stripes: %d",
					i, ctx->req_list[cookie]->num_stripes[i]);
		}
		rc = cam_ope_mgr_reset_hw();
		evt_id = CAM_CTX_EVT_ID_ERROR;
+17 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/of.h>
@@ -787,6 +787,11 @@ static uint32_t *ope_create_stripe_cmd(struct cam_ope_hw_mgr *hw_mgr,
	uint32_t *print_ptr;
	int num_dmi = 0;
	struct cam_cdm_utils_ops *cdm_ops;
	uint32_t reg_val_pair[2];
	struct cam_hw_info *ope_dev;
	struct cam_ope_device_core_info *core_info;
	struct ope_hw *ope_hw;
	struct cam_ope_top_reg *top_reg;

	if (s_idx >= OPE_MAX_CMD_BUFS ||
		batch_idx >= OPE_MAX_BATCH_SIZE) {
@@ -868,10 +873,21 @@ static uint32_t *ope_create_stripe_cmd(struct cam_ope_hw_mgr *hw_mgr,
			}
			CAM_DBG(CAM_OPE, "Stripe:%d Indirect:X", stripe_idx);
		}

		if (hw_mgr->frame_dump_enable)
			dump_stripe_cmd(frm_proc, stripe_idx, i, k,
				iova_addr, kmd_buf, buf_len);
	}

	ope_dev = hw_mgr->ope_dev_intf[0]->hw_priv;
	core_info = (struct cam_ope_device_core_info *)ope_dev->core_info;
	ope_hw = core_info->ope_hw_info->ope_hw;
	top_reg = ope_hw->top_reg;

	reg_val_pair[0] = top_reg->offset + top_reg->scratch_reg;
	reg_val_pair[1] = stripe_idx;
	kmd_buf = cdm_ops->cdm_write_regrandom(kmd_buf, 1, reg_val_pair);

	return kmd_buf;
}

+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 */

#ifndef CAM_OPE_HW_H
@@ -82,6 +82,7 @@ struct cam_ope_top_reg {
	uint32_t violation_status;
	uint32_t throttle_cnt_cfg;
	uint32_t debug_cfg;
	uint32_t scratch_reg;
	uint32_t num_debug_registers;
	struct cam_ope_debug_register *debug_regs;
};
+6 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 */

#ifndef CAM_OPE_HW_100_H
@@ -146,6 +146,9 @@ static struct cam_ope_debug_register ope_debug_regs[OPE_MAX_DEBUG_REGISTER] = {
	{
		.offset = 0xD0,
	},
	{
		.offset = 0xD4,
	},
};

static struct cam_ope_top_reg ope_top_reg = {
@@ -163,7 +166,8 @@ static struct cam_ope_top_reg ope_top_reg = {
	.violation_status    = 0x28,
	.throttle_cnt_cfg    = 0x2C,
	.debug_cfg           = 0xDC,
	.num_debug_registers = 9,
	.scratch_reg         = 0x1F0,
	.num_debug_registers = 10,
	.debug_regs          = ope_debug_regs,
};

Loading