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

Commit 700dd0f7 authored by Suresh Vankadara's avatar Suresh Vankadara Committed by Prakasha Nayak
Browse files

msm: cam: icp: dump IOCONFIG command data in case of io config failure



Dump IOCONFIG command for IPE and BPS in case of io config failure.

Change-Id: Iae730f46e4b3f2e327ac10587896a4e755f96a38
Signed-off-by: default avatarSuresh Vankadara <svankada@codeaurora.org>
Signed-off-by: default avatarPrakasha Nayak <pnayak@codeaurora.org>
parent f81cd669
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -64,6 +64,37 @@ static struct cam_icp_hw_mgr icp_hw_mgr;

static void cam_icp_mgr_process_dbg_buf(unsigned int debug_lvl);

static int cam_icp_dump_io_cfg(struct cam_icp_hw_ctx_data *ctx_data,
	int32_t buf_handle)
{
	uintptr_t vaddr_ptr;
	uint32_t  *ptr;
	size_t    len;
	int       rc, i;
	char      buf[512];
	int       used = 0;

	rc = cam_mem_get_cpu_buf(buf_handle, &vaddr_ptr, &len);
	if (rc) {
		CAM_ERR(CAM_ICP, "Unable to get io_cfg buf address for %d",
			ctx_data->ctx_id);
		return rc;
	}

	len = len / sizeof(uint32_t);
	ptr = (uint32_t *)vaddr_ptr;
	for (i = 0; i < len; i++) {
		used += snprintf(buf + used,
			sizeof(buf) - used, "0X%08X-", ptr[i]);
		if (!(i % 8)) {
			CAM_INFO(CAM_ICP, "%s: %s", __func__, buf);
			used = 0;
		}
	}

	return rc;
}

static int cam_icp_send_ubwc_cfg(struct cam_icp_hw_mgr *hw_mgr)
{
	struct cam_hw_intf *a5_dev_intf = NULL;
@@ -4665,6 +4696,8 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
	rc = cam_icp_mgr_send_config_io(ctx_data, io_buf_addr);
	if (rc) {
		CAM_ERR(CAM_ICP, "IO Config command failed %d", rc);
		cam_icp_dump_io_cfg(ctx_data,
			icp_dev_acquire_info->io_config_cmd_handle);
		goto ioconfig_failed;
	}